Favorite places of your favorite city
Home
Add to preferred sources on Google

HTML Entity Encoder/Decoder

Convert literal text to or from HTML character references without parsing or rendering markup. Choose the operation, inspect the result and copy or download it. Line endings use LF, including decoded CR references.

Input

Line endings use LF, including decoded CR references. Up to 100,000 UTF-16 units and 262,144 UTF-8 bytes.

Result

Enter text and choose an action.

Local conversion

This tool processes text in your browser without tool-added uploads or saved history.

Conversion uses a browser worker. Site services remain subject to site policies.

Choose one literal-text conversion

  1. Paste text and choose Encode or Decode. The same input stays when switching direction; output is never silently moved into input. Empty input cannot convert, but spaces, tabs and newlines are meaningful data. Input CRLF and lone CR become LF.
  2. For Encode, Keep Unicode escapes six punctuation characters and keeps other admitted Unicode. ASCII references also encodes non-ASCII characters as references, with hexadecimal, decimal or named-preferred output and hexadecimal fallback. For Decode, choose Text segment or Attribute-value text; this controls reference ambiguity, not HTML document parsing.
  3. Select Encode text or Decode references. Read the literal result and its UTF-8 byte and Unicode-scalar counts. Copy and Download use the complete current result even when the ordinary preview is shortened. Decode runs once, then normalizes any newly decoded CR or CRLF to LF.

Understand references without confusing contexts

Keep Unicode replaces ampersand, less-than, greater-than, double quote, apostrophe and backtick. Accents, emoji and other admitted Unicode can remain literal in UTF-8 text. ASCII references is a representation choice, not a requirement to encode every letter or a promise of safety in every HTML, URL, JavaScript or CSS context.

Named references are case-sensitive and can produce more than one Unicode scalar. Legacy missing-semicolon references may be recovered differently in text and attribute-value contexts. Unknown or incomplete references can stay literal. This pinned recovery behavior does not validate a document or report every current tokenizer error.

Decode treats the whole argument as reference-bearing text. Tags and quotes are not parsed, and even script-looking text stays inert output here. Decoding &amp;lt; once leaves &lt; as literal text instead of decoding it again to <. Encoding already-written references escapes their ampersands again because they are input data.

Both input and result use LF line endings. Decode can turn a numeric CR reference into CR internally, but this tool then changes it to LF; a decoded CRLF pair becomes one LF. There is no other trimming, Unicode normalization, signature removal or added final newline. The result is not a sanitizer or an HTML validity verdict.

Follow source, conversion and output

The Encode example is <b>café & 😀</b>, 19 UTF-8 bytes. Keep Unicode produces &lt;b&gt;café &amp; 😀&lt;/b&gt;, 35 bytes and 31 Unicode scalars. Its 32 UTF-16 units differ because the emoji occupies a pair. Markup remains text rather than becoming a live element.

For that same source, ASCII references produces 53 bytes in Hexadecimal, 48 in Decimal and 46 in Named preferred. Named preferred can use a named accent reference while falling back to hexadecimal for the emoji. These are textual representations, not stronger security modes or claims that one spelling is the only valid reference.

The Decode example is 39 ASCII bytes and recovers a literal b-tagged line followed by CRLF, 15 bytes. One CRLF normalization makes the current result 14 UTF-8 bytes with LF. Text decoding of &amp=1 gives &=1, while Attribute-value text retains the original sequence; neither mode locates actual attributes in the source.

Explicit Unicode, size and runtime bounds

Canonical input fits 100000 UTF-16 units and 262144 UTF-8 bytes. A raw edit candidate above 200000 units, or still above 100000 after LF conversion, is rejected visibly without silently cutting it. Semantic or byte-limit errors leave the bounded draft editable. These units are not words or user-perceived characters.

Source and output reject isolated surrogates, C0 controls except tab and LF after line-ending normalization, DEL and C1 controls, U+FDD0 through U+FDEF and scalars ending in FFFE or FFFF. Other admitted combining, RTL, joining and formatting characters remain data. This is a declared narrower text profile, not a claim that every rejected character is invalid HTML or Unicode.

Recovery can itself create a forbidden output character. The reference for 128 becomes the euro sign, but references producing U+0081, U+0001 or U+FDD0 fail output validation. Zero, surrogate-valued and out-of-range numeric references recover U+FFFD and can be accepted. No characters are silently removed to force an output through this profile.

The complete result fits 1048576 UTF-8 bytes and UTF-16 units. The ordinary preview shows at most 100000 Unicode scalars and marks any clipping; full Copy, its readonly fallback and Download retain the complete current result. A 15000 millisecond worker watchdog produces no partial export on failure. Library intermediates can be larger than the final result cap; these bounds are not memory or throughput certification.

Local conversion and current text

This tool adds no upload, account, saved history, input logging or text-bearing share URL. Conversion runs in a bounded browser worker; edits, options, cancellation and clearing retire obsolete results and export feedback. Existing site services remain subject to site policies; local processing does not certify those services or deployment.

Questions about HTML entity conversion

No. It transforms references in literal text, not tags, attribute permissions or URL protocols, and it is not universal escaping for unquoted attributes, URLs, JavaScript or CSS. The result is inert in this tool, but the destination context still matters.

HTML reference recovery treats an unterminated named reference followed by certain characters differently inside an attribute value. The selected context applies to the whole text segment; it does not find actual tags or attributes and is not a safety guarantee.

Not in modern UTF-8 HTML text. Keep Unicode preserves admitted characters while escaping six punctuation characters. ASCII references is available when you want reference spellings, and Named preferred uses numeric fallback where the library has no chosen name.

This tool deliberately uses LF for both its input and final output, including CR created by decoding. That keeps displayed text, Copy fallback and downloaded text consistent. It is an additional format policy, not exact preservation of every raw HTML-decoded line ending.

No. It makes one pass. A decoded ampersand followed by lt; remains a literal reference spelling until you explicitly provide that result as new input. There is no automatic inverse, recursive decoding or silent prevention of double encoding.

Nonempty admitted whitespace is valid data and can be copied or saved. The ordinary preview is explicitly shortened when needed, while Copy and Download use the full checked current result. No explanatory heading, BOM or final newline is added, and a literal U+FEFF remains data.

Sources

These references explain the rules and implementation, not certification of an insertion context.

JSON to YAML

Convert JSON to YAML locally while preserving number text and quoted strings; copy or download the complete result.

Open tool — JSON to YAML

YAML to JSON

Convert one YAML document locally to JSON with exact number text and bounded aliases, then copy or download the complete result.

Open tool — YAML to JSON

HTML to Markdown

Convert pasted or local HTML into Markdown, review conversion notes, and copy or download the result.

Open tool — HTML to Markdown

JavaScript Regex Tester

Test a JavaScript pattern locally and inspect matches, captures, and UTF-16 positions.

Open tool — JavaScript Regex Tester

Markdown to HTML

Convert a Markdown draft to an HTML fragment, inspect the source and inert preview, then copy or download it.

Open tool — Markdown to HTML

Text Sorter

Sort lines alphabetically by a chosen language or by Unicode code point, keeping duplicates, blank rows and complete line contents.

Open tool — Text Sorter

Remove Duplicate Lines

Keep the first copy of each exact text line, preserving order, significant spaces and blank rows, then copy or download the result.

Open tool — Remove Duplicate Lines

Text Diff Checker

Compare two drafts locally, with exact whole-line changes, visible whitespace rules and clear final-newline handling.

Open tool — Text Diff Checker

Case Converter

Convert text to uppercase, lowercase, capitalized words or sentence case with explicit letter rules.

Open tool — Case Converter

Markdown Table Generator

Edit a small literal-text table, set alignment and copy GFM Markdown or import tab-separated text.

Open tool — Markdown Table Generator

Query String Parser & Builder

Edit ordered URL parameters, retain repeated names and copy a normalized query or HTTP(S) URL.

Open tool — Query String Parser & Builder

URL Encoder & Decoder

Convert a UTF-8 URL component or form value with explicit space and plus rules, then copy or download the result.

Open tool — URL Encoder & Decoder

Base64 Encoder & Decoder

Encode UTF-8 text as standard or URL-safe Base64, or decode either format with clear errors and complete text output.

Open tool — Base64 Encoder & Decoder

XML Formatter

Check namespace-aware XML 1.0, format or compact locally, and copy or download UTF-8 output.

Open tool — XML Formatter

JSON Formatter & Validator

Check JSON syntax, format or minify locally, and copy or download output while preserving original data tokens.

Open tool — JSON Formatter & Validator

SMS Character Counter & Segment Calculator

See how your message is encoded, where its segments end and what it may cost. Your text stays in your browser.

Open tool — SMS Character Counter & Segment Calculator

Social Media Character Counter

Check platform-specific limits and split posts without losing text.

Open tool — Social Media Character Counter

Character Counter

Count characters, words, sentences and paragraphs. Check word density, reading time and UTF-8 size, all in your browser.

Open tool — Character Counter

Text Size Calculator

Compare text encodings and payload sizes in your browser.

Open tool — Text Size Calculator

PDF Text Cleaner

Fix line breaks and spacing in text copied from a PDF. Preserve your original and review ambiguous hyphens before copying the cleaned text.

Open tool — PDF Text Cleaner

Fancy Text Converter

Convert supported fancy Unicode letters to normal text locally. Keep case, accents, emoji and your original text.

Open tool — Fancy Text Converter

Garbled Text Fixer

Fix garbled text and repair broken accents with a browser-based mojibake fixer. Review each possible UTF-8 reversal before applying it.

Open tool — Garbled Text Fixer

Gmail Clipping Checker

Measure email HTML bytes in UTF-8, compare them with an advisory 102,000-byte Gmail reference, and inspect size contributors locally.

Open tool — Gmail Clipping Checker
View all tools in this category