All Tools View Categories About Contact Privacy

Convert HTML Entities to ASCII

Browser-side conversion with validation, inspection, Copy, and Download.

Your input is processed locally in the browser.

About Convert HTML Entities to ASCII

Convert HTML Entities to ASCII decodes HTML character references back into plain, readable ASCII. When HTML is escaped, characters like <, >, and & are stored as <, >, & or numeric forms such as A and A. This decoder reverses that, turning references into the characters they represent while keeping the result as text so it is not executed as markup.

The importance is in the distinction between visible text and source representation. The same visual A can be stored as A, A, or A depending on the generator. When inspecting exports, templates, or scraped data, you need to see what the characters actually are, not how they were escaped. The tool does that deterministically and reports problems instead of guessing: if a reference resolves to a code point above 127, it errors because this ASCII-focused tool is intentionally strict; if a reference is unknown like &unknown; or malformed like &#xZZ;, it reports the exact token.

Supported inputs are the ASCII-relevant named entities (& < > " ') plus decimal (A) and hexadecimal (A) numeric references. The implementation scans with /&(?:amp|lt|gt|quot|#39|#([0-9]+)|#x([0-9a-fA-F]+));/g, validates each numeric value is an integer 0–127, and then reconstructs the string while tracking a token table of {input, result} pairs. A final check /&[^;\s]{1,40}(?:;|$)/ catches any leftover ampersand sequences so typos like & (missing ;) are surfaced. The result powers the main output, a stats line (changed count), and a 200-row token table for inspection. All steps run locally; the tool also offers a strict ASCII validator so you can confirm the decoded text is pure 0–127 before further processing. Start with the sample Hello <world> & "friends"! and replace it with your own fragment containing the entities you care about.

Features

  • Named entities: decodes & < > " ' which cover the ASCII-relevant HTML escapes.
  • Decimal numeric: AA with integer validation.
  • Hex numeric: A / AA case-insensitive.
  • Strict ASCII: rejects code points >127 instead of silently transliterating.
  • Malformed detection: reports unknown names and incomplete references via a final ampersand scan.
  • Inspection aids: changed-count stats and a token-by-character table (first 200 entries) for auditing.
  • Plain-text output: decoded string is inserted via textContent, never as HTML, so it cannot execute.
  • Sample and reset: Load sample and Clear controls for repeatable testing.
  • Copy and download: clipboard with execCommand fallback and Blob download.
  • Local-only: no upload, no external API, no dependency on a parser library.

How to Use

  1. Paste escaped text: put HTML-escaped content in the input, preserving entities like <tag> or A.
  2. Convert: click Convert. The tool decodes known entities, validates each numeric value, and reports the first error if any token is unknown or out of range.
  3. Inspect the table: check the token table to see which inputs became which characters and how many entities changed.
  4. Fix source errors: if an unknown entity is reported, correct the source or replace it with a numeric reference.
  5. Confirm ASCII: verify the stats show the expected output length and that no non-ASCII remains.
  6. Copy or download: use Copy (with fallback) or Download to get the plain text for the next pipeline step.
  7. Round-trip (optional): encode the result again with an ASCII-to-HTML tool and compare to catch double-encoding issues.

Examples

Angle brackets: <tag><tag> as text, showing how markup delimiters are restored without becoming live tags.

Quotes and ampersand: "friends" & family"friends" & family, common in attribute values.

Decimal and hex: A A A all → A A A, demonstrating that different numeric styles converge.

Error case: È (code 200 >127) or &unknown; triggers a clear error instead of silent replacement, and & (missing ;) is flagged as malformed.

Round trip: encode A&BA&B, decode back → A&B, and diff the two strings to ensure no data loss.

Benefits

  • Restores readability: turns escaped source into human-readable ASCII.
  • Deterministic: strict ASCII and malformed checks make the output inspectable and debuggable.
  • Safe: output stays as text via textContent, not executable HTML.
  • Debugging aid: token table and changed count expose exactly what was transformed.
  • Useful for pipelines: ideal for cleaning exports, templates, and scraped data before ASCII processing.
  • Local and fast: runs in the browser with no uploads and no parser dependency.

Frequently Asked Questions

Which entities are supported?
Common ASCII-oriented named references plus numeric decimal and hexadecimal references.
Can hex references be decoded?
Yes, for example &#x41; becomes A.
What happens to an unknown entity?
It is reported as an error.
Can it decode Unicode references?
No, decoded results must remain in ASCII.
Does it execute decoded HTML?
No.
Can I decode twice?
You can, but double-decoding can be a pipeline error.
Are spaces preserved?
Yes.
Can I copy the result?
Yes.
Can I download it?
Yes.
Does the input upload?
No.