Parse HTML: Escape, Encode and Decode
Paste code to parse (escape) HTML so it shows as text in a Blogger or WordPress post: < becomes <, > becomes > and & becomes &. The same box encodes and decodes URLs, Base64, JavaScript strings and Unicode escapes, all in your browser.
Advertisement
How to parse HTML for a Blogger post
- Paste the code you want to show (HTML, CSS, JavaScript or an AdSense snippet).
- Keep HTML entities and Encode, and tick Wrap in a code block.
- Copy the output.
- In Blogger, open the post in HTML view and paste where the code should appear.
- Preview the post: the code shows as text, with spaces and line breaks kept.
What each mode does
| Mode | Encoded | Use it for |
|---|---|---|
| HTML entities | <a href="/menu?item=kopi&size=L">Kopi & teh ☕</a> | Showing code in Blogger or WordPress posts, HTML attributes |
| URL | %3Ca%20href%3D%22%2Fmenu%3Fitem%3Dkopi%26size%3DL%22%3EKopi%20%26%20teh%20%E2%98%95%3C%2Fa%3E | Query string values, links with spaces or Malay/Chinese text |
| Base64 | PGEgaHJlZj0iL21lbnU/aXRlbT1rb3BpJnNpemU9TCI+S29waSAmIHRlaCDimJU8L2E+ | Data URLs, email attachments, APIs that need text |
| JavaScript / JSON string | <a href=\"/menu?item=kopi&size=L\">Kopi & teh ☕</a> | Putting text inside a JavaScript or JSON string |
| Unicode \u escapes | <a href="/menu?item=kopi&size=L">Kopi & teh \u2615</a> | Source code and JSON that must stay ASCII |
Advertisement
Common HTML entities
| Character | Named | Numeric |
|---|---|---|
| < | < | < |
| > | > | > |
| & | & | & |
| " | " | " |
| ' | ' | ' |
| (non-breaking space) | |   |
| © | © | © |
| ’ | ’ | ’ |
| — | — | — |
| … | … | … |
| € | € | € |
| × | × | × |
Security: escaping only changes how text is displayed. Base64 and URL encoding hide nothing: anyone can decode them. Never put passwords or private keys in encoded links.
Sources
Frequently asked questions
What does parse HTML mean in Blogger?
"Parsing" HTML for Blogger means escaping it: < becomes <, > becomes >, & becomes & and quotes become " and '. The browser then shows the code as text instead of running it, which is what you need to display HTML, CSS or JavaScript examples in a post. For example <a href="/menu?item=kopi&size=L">Kopi & teh ☕</a> becomes <a href="/menu?item=kopi&size=L">Kopi & teh ☕</a>.
How do I show code in a Blogger post?
Paste the code, keep HTML entities and Encode selected, tick Wrap in a code block, and copy the result. In the Blogger post editor, switch to HTML view and paste it where the code should appear. The <pre> keeps spaces and line breaks; the <code> marks it as code for screen readers and search engines.
Do I need to parse AdSense code before adding it to Blogger?
Not if you add it the recommended way: in Layout, Add a Gadget, HTML/JavaScript, paste the AdSense code unchanged. Only code pasted into the theme XML (Theme, Edit HTML) must be valid XML, where a bare & inside a script breaks saving; write it as & there. Never escape the < and > of a script you want to run, or it will show as text.
What is the difference between encodeURI and encodeURIComponent?
encodeURIComponent encodes everything that has a meaning in a URL, including / ? & = and #, so use it for one value such as a search term or a parameter. encodeURI leaves those characters alone, so use it for a whole address that only needs spaces and non-ASCII letters fixed. Tick Whole URL to use encodeURI.
Is Base64 encryption?
No. Base64 only rewrites bytes with 64 safe characters (A–Z, a–z, 0–9, + and /) so binary data can travel in text such as email, JSON or data URLs. Anyone can decode it instantly, so never use it to hide passwords or links. It also makes data about 33% larger.
How do I escape a string for JavaScript or JSON?
Choose JavaScript / JSON string and Encode. Quotes become \", backslashes \\, line breaks \n and tabs \t, and </script> becomes <\/script> so it cannot end a script block early. Paste the result between double quotes. Decode does the reverse and also understands \x41, \u0041 and \u{1F600}.
Is my code uploaded?
No. Every conversion runs in your browser with JavaScript, so tokens, keys and private code never leave your device. Only your last input is kept in this browser's storage.
Share this parse HTML tool
Advertisement