NV ToolkitFormat · Validate · Convert

Escape / Unescape

11 free tools · 100% client-side

Escape and unescape strings for HTML, XML, JavaScript, Java, .NET, JSON, CSV, and SQL — instantly and privately in your browser.

Start here

Most-used Escape / Unescape

All 11 Escape / Unescape

HTML Escape

Convert text to safe HTML entities and back — <, >, & and quotes handled, named and numeric entities decoded.

XML Escape

The five XML entities, handled both directions — make any text safe inside elements and attributes.

JavaScript Escape

Make any text safe inside a JavaScript string literal — quotes, backslashes, newlines and control characters handled both ways.

Java Escape

Java-ready string literals from any text — full \uXXXX Unicode escaping for clean, ASCII-safe source files.

.NET Escape

C#-ready string literals from any text — standard escapes plus \uXXXX Unicode, decoded back just as easily.

JSON Escape

RFC 8259 string escaping both ways — make any text safe inside a JSON string, or decode the backslash soup back to text.

CSV Escape

RFC 4180 field escaping — values with commas, quotes, or line breaks wrapped and doubled correctly, and unwrapped just as cleanly.

SQL Escape

Three escaping styles for SQL string literals — ANSI quote doubling, MySQL backslashes, or LIKE-pattern wildcards — and back again.

Python Escape

Turn any text into a Python string literal body — plain UTF-8, ASCII-only with \u/\U escapes, or a bytes literal — and decode repr() output back.

Regex Escape

Turn any literal text into a safe regex fragment — five flavors, so the escaping matches the engine that will actually compile the pattern.

Shell Escape

Wrap a string the way a POSIX shell or PowerShell actually needs it quoted — including the output's own quotes, ready to paste into a command line.

Learn more

The right escaping for the right context

Escaping bugs are context bugs: HTML entities inside a JavaScript string, SQL quoting applied to JSON, CSV fields that break on an unquoted comma. Each tool here implements one context's exact rules — HTML/XML entity encoding, JavaScript and Java string literals, .NET verbatim strings, JSON's backslash escapes, CSV's quote-doubling, SQL's single-quote doubling — with both escape and unescape directions, so a string can be safely embedded or recovered without consulting a spec.

Every page round-trips: escape, then unescape, returns the original byte-for-byte, including Unicode beyond the ASCII range. That property is the test these tools are built against, and it's why copying a result into source code or a data file just works.

Escaping is encoding, not security

A word of honesty that competitor pages skip: escaping makes text safe to embed in a syntax, not safe in the security sense. SQL escaping prevents a quote from terminating a literal — parameterized queries are still the real injection defense; HTML escaping prevents markup interpretation — a CSP and framework auto-escaping are still your XSS strategy. Use these tools for correctness in fixtures, logs, config files, and migrations, and keep the security mechanisms in your stack.

Which escape scheme do I need?

The escape tools split into a few real syntactic families, not eleven unrelated pages. HTML and XML share entity encoding — the same handful of special characters turned into named-entity sequences — differing mainly in which named entities each markup language recognizes. JavaScript, Java, .NET and Python share C-style string-literal escaping — backslash sequences for quotes and control characters, plus Unicode escapes for Java, .NET and Python's ASCII-only mode — differing mainly in which characters get that Unicode treatment and, for Python, whether it uses a surrogate pair or a single \U escape for characters above the Basic Multilingual Plane. JSON escaping is its own strict subset of that grammar, defined by RFC 8259 rather than a compiler. Regex escaping is a family of its own — it hides metacharacters from a PATTERN COMPILER, not from a string parser, so its character set (dots, parentheses, brackets) has nothing to do with the C-style family. CSV escaping and shell quoting are both wrapping mechanisms rather than backslash schemes — CSV wraps a field in quotes and doubles inner quotes, POSIX shells wrap a whole word in single quotes and splice out any embedded one — and SQL escaping is simpler still: doubling the single quote that delimits a string literal. Picking the right tool is really picking the right family, then the right member of it.

Escape schemes at a glance
ToolInputOutputBest for
HTML EscapePlain textHTML entities (< & " …)Embedding text safely in a web page
XML EscapePlain textThe five predefined XML entitiesEmbedding text in an XML document or SOAP message
JavaScript EscapePlain textA JavaScript string-literal bodyBuilding a double-quoted JS string by hand
Java EscapePlain textA Java string-literal body with \uXXXX UnicodeASCII-safe Java source and .properties files
.NET EscapePlain textA C# / .NET string-literal bodyC# and F# source (not VB.NET's own grammar)
Python EscapePlain textA Python str/bytes literal bodyPython source — str, ASCII-only or bytes styles
JSON EscapePlain textA JSON string body (RFC 8259)Embedding text in a JSON field by hand
Regex EscapePlain textA regex pattern fragment (5 flavors)Matching a literal string inside a larger pattern
CSV EscapeA field valueA quoted, doubled-quote CSV fieldBuilding a CSV row by hand
SQL EscapePlain textA SQL string literal (quotes doubled)Hand-written SQL scripts, fixtures, and migrations
Shell EscapePlain textA quoted shell word (bash/sh or PowerShell)Pasting a value safely into a command line

Help

Frequently asked questions

Everything you need to know about the Escape / Unescape.

01Which escape tool do I need?

Match the destination: embedding in a web page → HTML Escape; an XML document → XML Escape; a string literal in code → the JavaScript, Java, .NET or Python escape; a JSON value → JSON Escape; a pattern-matching engine → Regex Escape; a spreadsheet field → CSV Escape; a SQL string literal → SQL Escape; a command-line argument → Shell Escape. The tool name is the context the output is safe for.

02What's the difference between escaping and encoding?

Escaping marks special characters so a parser treats them as data within a syntax (& becomes & in HTML). Encoding transforms an entire payload into a different representation (Base64, URL percent-encoding). If the output must remain readable text in the same language, you want escaping; if it must survive transport, you want the encoding tools.

03Why does unescaping my string produce weird characters?

Usually double-escaping: the input was escaped twice (\\n instead of \n, & instead of &), so one unescape pass reveals the intermediate form. Run unescape again — and fix the producer, which is double-encoding somewhere upstream.

Learn the format

Guides for escape / unescape

All guides →