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
Encode turns source text into entities; decode turns entities back into text, one layer at a time. Format, preservation and decode context affect only the next action. A failure keeps the current text.
Enter text or load an example. Empty input converts to empty output.
0 UTF-16 units
Format and preservation affect the next encode; decode context affects the next decode. Neither rewrites the current text. Encoding preserves U+0020–U+007E plus TAB, CR and LF except &, <, >, both quotes and backtick. Disable preservation to encode everything. Decoding resolves one HTML5 layer; unknown references remain. Numeric invalid values and C1 follow HTML replacements.
First input: 1,048,576 UTF-16 units. Output and later processing of a generated document: 4,194,304 units. Empty input is valid. Pasting may normalize line endings.
Conversion stays in this browser; input is not uploaded. Undo history stays in this tab. Long documents limit how much history is kept.
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.
Nothing runs automatically. Click Encode text or Decode entities, or press Ctrl/Cmd+Enter to encode and Ctrl/Cmd+Shift+Enter to decode. Options affect only the next action. A failure keeps the current text and does not add a successful history step.
Example and Clear start a new document and can be undone. Undo and redo cover edits, conversions, restoring the original, examples and clearing. Copy and download export the full current text. The plain-text preview matches only the latest successful conversion, shows at most 20,000 UTF-16 units, never executes tags, and is not the document.
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.