Keep ordinary text readable
Encoding starts with named references and basic text preserved: printable ASCII plus TAB, CR and LF. The six characters &, <, >, both quotes and the backtick are always encoded; non-ASCII is encoded too.
Encoding and escaping
with one-pass decoding
Preview displays at most 20,000 UTF-16 units as text; markup is not executed.
Conversion stays in this browser; input is not uploaded.
Encoding preserves U+0020–U+007E plus TAB, CR and LF except &, <, >, both quotes and backtick. Disable preservation to encode everything. Decoding resolves one layer with HTML5 text or attribute rules; unknown references remain. Numeric invalid values and C1 follow HTML replacements.
Input: 1,048,576 UTF-16 units; output: 4,194,304 units. Empty input is valid. Pasting may normalize line endings.
Enter text or load an example. Empty input converts to empty output.
Reverse uses the fresh result as input and changes direction after confirmation. It is unavailable when the result exceeds the input limit.
The HTML entity encoder helps when a code example must display angle brackets or when a CMS value arrives as character references. Choose readable names or numeric HTML entities according to the receiving format.
An HTML entity decoder restores references without parsing a document. HTML escape changes the representation of characters; it does not decide whether a complete template, script or URL is safe.
This HTML entity encoder offers named references, decimal numbers and uppercase hexadecimal numbers. A missing name falls back to hexadecimal, so symbols outside the named table can still be represented.
Decoded angle brackets remain visible text in the result and preview. A tag-shaped value never becomes a live page here, letting you inspect copied examples without creating document elements.
Encoding starts with named references and basic text preserved: printable ASCII plus TAB, CR and LF. The six characters &, <, >, both quotes and the backtick are always encoded; non-ASCII is encoded too.
Automatic mode waits 350 ms after edits. Turn it off to show Convert, or use Ctrl/Cmd+Enter. Input and option changes mark the previous result stale and disable export until conversion succeeds.
Example, Clear and Reverse show a preview before Apply. Undo restores the input, options and result together. Preview stops at 20,000 UTF-16 units without splitting surrogate pairs; export uses the full result.
The complete HTML5 named-reference table includes symbols beyond the familiar & and <. Decimal and hexadecimal references are supported in the same decode input. Named HTML5 references may represent two code points together, such as fj becoming fj when all text is encoded.
The default is text context. Attribute context changes how legacy names without a semicolon are recognized, especially before an ASCII letter, digit or equals sign.
Decoding &lt; produces <, not a less-than sign. Unknown references remain unchanged. Each run resolves references in the input once.
A raw NUL or isolated UTF-16 surrogate is rejected with a line and column. Numeric references to invalid code points follow HTML replacement rules instead of source-text validation.
Use the HTML entity encoder when literal text such as <article> should be represented by character references. Match the escaping method to the destination context; this page handles characters, not complete document security.
It means replacing recognized character references with their characters: & becomes & and < becomes <. Here this happens once and the result remains plain text.
It can be one part of context-appropriate output escaping, but it is not a sanitizer or a general XSS guarantee. Script, style, URL and attribute contexts require their own handling.
A name such as © identifies a character through the HTML table. Decimal © and hexadecimal © identify its code point. Named encoding uses hexadecimal when no suitable name exists.
The source may contain &lt;, which has two encoding layers. One decode returns <. Review that output before deliberately decoding it again; recursive decoding is not automatic.
Found an encoding edge case?
Choose the HTML entity encoder format, inspect the plain-text result, and copy the complete value when it is current.