OxyPages

HTML Encoder: Escape Text To HTML Entities

Turn characters that would break your markup into HTML entities you can paste anywhere.

Free. No account. Live in seconds.
Text to encode
HTML entities
Input 317 charactersOutput 426 characters (+109)
Free. No account. Your text goes live as a plain page in seconds.

How It Works

How To Use The HTML Encoder

  1. 1

    Paste The Text

    Type or paste the text you need inside your HTML - a code sample, an attribute value, a comment a visitor wrote. The result updates as you type.

  2. 2

    Pick An Entity Style

    Choose named (©), numeric (©) or hex (©) entities, and decide whether to encode every non-ASCII character or only the five reserved ones.

  3. 3

    Copy Or Publish

    Copy the encoded text straight into your markup, or publish it as a page to see exactly how a browser reads it back.

About This Tool

Why You Need To Escape HTML, And What This Tool Does About It

Five characters carry meaning in HTML. Put them in the wrong place and the browser reads your text as markup.

An HTML encoder replaces characters that have a special meaning in markup with HTML entities: a short code the browser displays as the original character without acting on it. The classic example is showing code on a page. If you write <p> inside a paragraph, the browser opens a new paragraph; write &lt;p&gt; instead and the reader sees the literal <p>. The same goes for &, which starts an entity, and for quotes, which end an attribute value early.

Who this is for

Most people arrive here holding a finished page from ChatGPT, Claude, a designer or a course and one stubborn paragraph that will not display right: a snippet of code, a product name with an ampersand, a quote inside a title attribute. Paste the text, copy the escaped version back into the page, and the problem is gone. Developers use the same tool to escape HTML before inserting user-written text into a template, which is also the first line of defence against injected scripts.

How the encoder works

Everything runs in your browser. The tool walks through your text one character at a time and swaps each reserved character - & < > " ' - for its entity. With Encode all non-ASCII ticked it also converts accented letters, symbols and typographic punctuation, using a well-known name where one exists (&copy;, &eacute;, &mdash;, &nbsp;) and a numeric reference otherwise. Switch the style to numeric or hex if your toolchain prefers &#169; or &#xA9;. Nothing is uploaded: the only time text leaves this page is when you press Publish.

Limits worth knowing

  • This is an HTML escape, not a URL encoder. Query strings and file names need percent-encoding instead.
  • The apostrophe becomes &#39; rather than &apos;, because the numeric form works in every HTML version and every browser.
  • If your page already declares <meta charset="utf-8">, non-ASCII characters are safe to leave as they are; encoding them is a choice, not a requirement.

From escaped text to a live page

The encoded text is usually destined for a page, so this tool ends the same way every OxyPages tool does: one button publishes the output on a free HTTPS link with no account needed. The link lasts 30 minutes unless you claim it, and claiming is free. If you are checking a whole document rather than a fragment, paste it into the HTML Viewer to see it rendered; to reverse the process, use the HTML Decoder. How publishing works explains the rest.

Questions

Frequently Asked Questions

Whenever text that contains <, >, &, or quotes must appear on a page as text rather than markup: code samples, attribute values, and anything a user typed that you are inserting into your template. Plain prose without those characters needs nothing.

Try It Now

Still Here? Drop It In.

The whole pitch fits in one sentence: your HTML, on a link, in seconds.

Drag and drop your HTML file(s), folders, or ZIP file

or ·

No account needed. Your unclaimed website stays live for 30 minutes on a free subdomain. Claim it to your account to keep it permanently.

  • No Account Needed
  • Free SSL
  • 30-Minute Unclaimed Link, Claim To Keep It