HTML Decoder

HTML Decoder is used to decode or unescape text that has been encoded using HTML encoding, back to it's original form.

All processing happens on the client-side, locally in your browser. No data is uploaded.

Paste HTML text below
Plain text

Settings

How the input is converted. Each is explained below.

History

  • 2017-10-26Scroll to ouput on submit (configurable)
  • 2017-10-26Ability to decode unicode escape characters & support for replacing non-breaking space with regular space in HTML Decoder
  • 2017-10-01Tool Launched

Settings explained

Decode unicode escape characters

If selected, replaces unicode escape characters such as \u0026 with their unicode character counterparts.

Input
Beauty \u0026 the Beast
Decode unicode escape characters on
Beauty & the Beast
Decode unicode escape characters off
Beauty \u0026 the Beast
Unescape backslash

If selected, double backslash \\ is converted to a single backslash \

This is useful if the entire input is encoded HTML inside a string in JavaScript or JSON.

Input
Beauty \\u0026 the Beast
Unescape backslash on
Beauty & the Beast
Unescape backslash off
Beauty \& the Beast
Use non breaking space

If selected,   is replaced by the non breaking space character \u00A0 else it is replaced by the regular space.

A non breaking space prevents a line break from appearing in its place when the text is being word wrapped.

Background

Certain characters need to be encoded (escaped) in HTML. Read more at wikipedia.

Example Substitutions

  • & → & (ampersand, U+0026)
  • &lt; → < (less-than sign, U+003C)
  • &gt; → > (greater-than sign, U+003E)
  • &quot; → " (quotation mark, U+0022)
  • &apos; → ' (apostrophe, U+0027)
  • &nbsp; → space (non breaking space, U+00A0)

How to do HTML encoding in various programming languages

LanguageEncodeDecodeExampleDocumentation
C#System.Net.WebUtility.HtmlEncode()System.Net.WebUtility.HtmlDecode()ExampleHtmlEncode() HtmlDecode()
VB .NETSystem.Net.WebUtility.HtmlEncode()System.Net.WebUtility.HtmlDecode()ExampleHtmlEncode() HtmlDecode()
Javaorg.apache.commons.lang.StringEscapeUtils.escapeHtml()org.apache.commons.lang.StringEscapeUtils.unescapeHtml()ExampleescapeHtml() unescapeHtml()
JavaScripthtmlEncode()htmlDecode()Example
Pythonhtml.escape()html.unescape()escape() unescape()Documentation

Related tools