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.
InputBeauty \u0026 the Beast
Decode unicode escape characters onBeauty & the Beast
Decode unicode escape characters offBeauty \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.
InputBeauty \\u0026 the Beast
Unescape backslash onBeauty & the Beast
Unescape backslash offBeauty \& 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)
- < → < (less-than sign, U+003C)
- > → > (greater-than sign, U+003E)
- " → " (quotation mark, U+0022)
- ' → ' (apostrophe, U+0027)
- → space (non breaking space, U+00A0)
How to do HTML encoding in various programming languages
| Language | Encode | Decode | Example | Documentation |
|---|---|---|---|---|
| C# | System.Net.WebUtility.HtmlEncode() | System.Net.WebUtility.HtmlDecode() | Example | HtmlEncode() HtmlDecode() |
| VB .NET | System.Net.WebUtility.HtmlEncode() | System.Net.WebUtility.HtmlDecode() | Example | HtmlEncode() HtmlDecode() |
| Java | org.apache.commons.lang.StringEscapeUtils.escapeHtml() | org.apache.commons.lang.StringEscapeUtils.unescapeHtml() | Example | escapeHtml() unescapeHtml() |
| JavaScript | htmlEncode() | htmlDecode() | Example | |
| Python | html.escape() | html.unescape() | escape() unescape() | Documentation |