Last updated ·Published ·By the WiserWork team

HTML Entity Encoder

Convert special characters to HTML entities & decode them back

Character Name Entity Numeric
Copied to clipboard!

Escaping is what stops a stray ampersand or angle bracket from breaking a web page, and this converter applies the standard entity substitutions in either direction as you type.

What is the HTML Entity Encoder?

An HTML entity is a stand-in code for a character the browser would otherwise read as markup. Write & and the page prints an ampersand instead of starting an entity of its own; write < and it prints an angle bracket instead of opening a tag. This tool holds a table of 17 such characters and rewrites your text in whichever direction you choose, replacing raw characters with their named entities or expanding entities back into the characters they represent.

Key Features

  • Encode and decode tabs sharing one input box and one output
  • Seventeen characters covered, from markup symbols to currency and math signs
  • Ampersands escaped first, so the entities it generates are never double-escaped
  • A 15-row table listing each character, name, named entity and numeric code
  • A swap button that flips direction and moves the result back up

Common Use Cases

  • Pasting a code sample into a blog post so it displays rather than renders
  • Escaping quotation marks and ampersands before dropping text into an HTML attribute
  • Reading an email source or log line where every symbol arrived as < and &
  • Looking up the entity for a copyright, trademark or degree symbol

How to Use the HTML Entity Encoder

  1. Choose Encode to Entities or Decode Entities from the pair of tabs at the top.
  2. Replace the sample in the upper monospace box with your own text or markup.
  3. Read the converted version in the read-only box underneath, which refreshes as you type.
  4. Hit Copy to take the result, or Swap to send it back up and reverse direction.
  5. Scroll to the reference table when you need the numeric form of a character instead.

Tips for Best Results

  • Only those 17 characters change; accented letters and emoji pass through as literal UTF-8.
  • Encode code samples before pasting them into a CMS, or the browser renders them as markup.
  • Apostrophes come out as the numeric ' rather than a named form, which older browsers handle more reliably.
  • Decoding understands only the same 17 entities, so anything like   or … is left as written.

Why Use WiserWork's HTML Entity Encoder?

Escaping by hand is where mistakes creep in, because the ampersand has to be handled before every other character or the entities you just wrote get escaped a second time. This page runs the passes in the right order and shows the result as you type, and the built-in table saves a trip to a specification when you need a numeric code instead of a name. Everything is computed in the page, so pasted source stays on your machine.

Who Uses the HTML Entity Encoder?

Front-end developers escaping code samples, technical writers publishing tutorials that contain markup, and CMS editors whose pasted text keeps rendering as tags all need this conversion regularly. Support staff use the decode direction to read raw email or log output that arrived fully escaped.

Frequently Asked Questions

Which characters does the encoder handle?

Seventeen: the ampersand, both angle brackets, the double quote and apostrophe, the copyright, registered and trademark marks, the euro, pound, yen and cent signs, the section and degree signs, and plus-minus, multiplication and division.

Does it escape every non-ASCII character?

No. Accented letters, curly quotes, dashes and emoji are left as they are, since a page served as UTF-8 displays them correctly without escaping.

Why does the table show 15 rows when 17 characters convert?

The table lists the fifteen most commonly needed characters. The cent and section signs are handled by the converter without appearing in it.

What is the difference between the Entity and Numeric columns?

The Entity column gives the named form, such as ©, and the Numeric column gives the code-point form, ©. Both produce the same character, but named entities are easier to read.

What happens if I encode text that is already encoded?

Its ampersands get escaped again, turning & into &. Switch to the Decode tab to reverse one layer at a time.

What does the Swap button do here?

It moves the output into the input box and switches the active tab, so you can immediately convert the result back and confirm it round-trips cleanly.

Does it recognize   or named entities for accented letters?

No. Decoding matches only the seventeen entities in its own table, so anything else stays exactly as it appears in your input.

Is the output safe to drop straight into an HTML attribute?

Escaping the double quote, apostrophe, ampersand and both angle brackets covers the usual attribute cases. For untrusted user input, escape on the server as well rather than relying on a manual copy-paste step.

Are line breaks and indentation preserved?

Yes. Only the mapped characters are substituted, so whitespace, tabs and the line structure of your markup survive in both directions.

Is anything uploaded?

No. The lookup table and both conversion passes live in the page, so unreleased markup and pasted source code never leave your machine.

Escaping is a small step that is easy to get subtly wrong by hand. Paste your markup in, take the escaped version out, and the ampersand-first ordering that trips people up is already handled for you.

Found this useful? Share it