HTML Encoder / Decoder
Encode text into HTML entities so it displays literally, or decode entities back into characters — with input and output counts. Free, no signup, everything runs in your browser.
Note: encoding covers the standard named and numeric entities. Decoding relies on the browser's parser and will normalize some inputs. This tool does not sanitize HTML for safe embedding — that is a separate security job.
What Is the HTML Encoder / Decoder?
A free HTML encoder is a tool that converts characters with special meaning in HTML — such as angle brackets, ampersands and quotes — into entities like < and &, so the text displays literally instead of being parsed as markup. The decoder reverses the process, turning entities back into characters. Paste text or HTML, pick a direction, and the tool returns the converted result with counts. If you need an HTML encoder for a code sample, a tutorial or a template, this page does the conversion in your browser.
What Is It Used For?
Bloggers use it to show code samples inside posts without the browser swallowing the tags. Tutorial writers use it to display HTML examples as text. Developers use it to prepare strings for templates and emails. Support teams use it to decode entity-filled snippets back into readable markup.
Key Benefits
- Both directions — encode to entities or decode entities back to characters.
- Standard entities — named entities for the common characters plus numeric entities where needed.
- Character and entity counts — see input and output sizes at a glance.
- Copy in one click — paste the result straight into your post or code.
- Completely free and private — no signup, and nothing you paste ever leaves your browser.
How to Use This Free HTML Encoder
- Paste your text or HTML into the box.
- Click Encode to turn special characters into entities, or Decode to turn entities back into characters.
- Read the counts to confirm the conversion did what you expected.
- Click Copy and paste the result where you need it.
Common Mistakes to Avoid With HTML Entities
- Encoding twice. Encoding already-encoded text turns & into &, which displays literally as & instead of &. Encode once, from the raw text.
- Forgetting the ampersand. A bare & in text can start an accidental entity. Encoding handles it, but hand-written HTML often misses it.
- Assuming encoding equals sanitizing. Entities stop markup from parsing as tags, but safe embedding of untrusted HTML needs a real sanitizer, not just encoding.
- Decoding untrusted HTML and pasting it live. Decoding restores real markup, including scripts. Never paste decoded untrusted HTML into a live page.
- Mixing numeric and named entities carelessly. Both are valid, but mixing them in one document makes it harder to read and debug — pick one style per document.
Frequently Asked Questions
Is this HTML encoder free? Yes, completely free — no signup, no limits, no account.
Is my text uploaded anywhere? No. Encoding and decoding happen entirely in your browser, so your text never leaves your device.
What is an HTML entity? A code that represents a character, written as an ampersand, a name or number, and a semicolon — for example < for the less-than sign — so the character displays as text instead of acting as markup.
Why encode angle brackets? Because the browser treats < and > as tag boundaries. To show a tag as text in a tutorial, its brackets must be entities, or the browser will try to render the tag.
Which characters does encoding cover? The standard set: ampersand, less-than, greater-than, double quote and single quote, plus non-ASCII characters as numeric entities where they appear.
What does decoding do with unknown entities? The browser parser leaves genuinely unknown entities as-is, and normalizes some inputs (for example, entities without a trailing semicolon in some positions). Decoding is therefore not always a perfect round-trip.
Does encoding make HTML safe to embed? Not by itself. Encoding stops text from parsing as markup, but safely embedding untrusted HTML is a separate security job that needs a proper sanitizer.
Can I encode only part of a document? Yes — paste just the snippet you need converted. The tool converts exactly what you give it, nothing more.
What is the difference between named and numeric entities? Named entities use a word (such as &), numeric entities use a code (such as &). Both display the same character; named ones are easier to read.
Why do counts change after encoding? Because each special character becomes several characters as an entity — one & becomes five characters as & — so encoded output is longer than the input.
Does it handle non-English characters? Yes. Non-ASCII characters are emitted as numeric entities on encode, and decoded back on decode.
Can I decode entities inside a full HTML page? Yes, but remember that decoding restores real markup. Only paste decoded output into a live page if you trust the source.
Does it work on mobile? Yes. The tool runs in any modern mobile browser and the layout adjusts to small screens.
Final Thoughts
Showing code as code is a small formatting job that breaks posts when done wrong. Encode here, paste the result, and your examples will display exactly as written.
Related Tools
Readability Checker
Check how easy your text is to read, with Flesch scores and grade levels.
Open Tool