AAllMyToolsa pocketful of little tools
ent

HTML entity encoder

DevNo. 29 / 84

Escape ampersands, angle brackets and quotes into HTML entities, or decode entities back into plain text, entirely in your browser.

entities are how HTML says a character without actually meaning it.

work surface

Math, not advice — results are indicative.Read the disclaimer.

most-used utilities

Show a tag

Escape a snippet of HTML so it appears as code instead of turning into a button.

Clean scraped text

Decode a paragraph full of ampersands and quotes after a copy-paste from a web page.

Apostrophe trouble

Turn an apostrophe into an entity that survives a strict template without ending the attribute early.

pro tips

Store text raw and escape it when it goes out. Escaping on the way in means double-escaped messes later.

Numeric entities are a safe bet for characters that a CMS, an email template or an old parser keeps mangling.

Decoding an entity does not make it safe to paste into HTML. It makes it readable; those are different jobs.

what it does

Turns the five characters that cause trouble in HTML — ampersand, less-than, greater-than, double quote and apostrophe — into entities, and turns entities back into the characters they stand for. The result updates as you type, and the text never leaves the page.

By default the output uses the familiar names: amp, lt, gt, quot and the numeric code for the apostrophe, which older parsers handle more reliably than the named version. Flip the numeric switch and every escaped character becomes a decimal code instead, handy when a template or a CMS has opinions about names.

It earns its keep when you need to show a tag on a page without the browser trying to render it, when a form or an API expects escaped values, when a scraped paragraph arrives full of ampersands, or when you are writing documentation about HTML and want the examples to stay examples.

Decoding is not sanitizing: a decoded tag is still text on this page, and it stays text when you copy it. Unknown entity names are left exactly as written, with a note naming up to three of them, because inventing a character is worse than admitting ignorance.

quick answers

Which characters does it encode?

The five usual suspects: ampersand, less-than, greater-than, double quote and apostrophe. Everything else passes through untouched.

Named or numeric entities — which should I use?

Named entities are easier to read; numeric ones are harder for a parser to argue with. The toggle gives you both, and the decoder accepts either.

Does decoding execute the HTML?

No. The result is displayed and copied as text, and nothing is inserted into the page as markup. Decode freely; render carefully.