This tool encodes text into HTML entities and decodes entities back into ordinary characters, both directions in your browser. HTML entities are the special codes that let you display reserved or unusual characters on a web page without breaking the markup. A handful of characters have meaning in HTML: the angle brackets that open and close tags, the ampersand that begins an entity, and the quotation marks that wrap attributes. If you want to show these literally as text, rather than have the browser treat them as code, you must replace them with their entity equivalents, a process called escaping. The same applies to characters that are hard to type or that vary between systems, which can be written as named or numeric entities to display reliably everywhere. Getting this right is essential for two reasons: pages render correctly, and, more importantly, escaping user input is a core defence against cross-site scripting, where unescaped angle brackets could let someone inject a script into your page. This tool makes the conversion effortless. You paste your text, choose to encode or decode, and the result appears instantly. Encoding replaces the reserved characters, and any non-standard ones, with their safe entity codes, ready to paste into HTML. Decoding does the reverse, turning entities back into the characters they represent, which is handy when you are reading or cleaning up content that has been escaped. Everything runs locally, so nothing is uploaded. Use it to safely display code samples on a page, to escape content before inserting it into HTML, to clean up text copied from a source that over-escaped it, or simply to understand how entities work.
Escaping HTML is a key defence against cross-site scripting. Runs entirely in your browser; nothing is uploaded.
To encode, the tool replaces the reserved HTML characters, the ampersand, the angle brackets and the quotation marks, with their named entity codes, so they display as literal text rather than being read as markup. To decode, it uses the browser's own parser to turn entity codes back into the characters they represent.
Encoding the snippet that shows a paragraph tag with Tom & Jerry said hi replaces the angle brackets, the ampersand and the quotes with their entity codes, so it can be displayed on a page as visible text instead of being rendered as an element. Decoding that escaped string returns the original characters.
If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.
Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.
All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.
Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.
Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.
Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.
All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.
© 2019 to 2026 Calculate.co.nz. All rights reserved.