Input

Mode:

Output

What Is JavaScript Unescape?

JavaScript Unescape converts escape sequences in a string back into their original characters. For example, \n becomes a real newline, \t becomes a real tab, \" becomes a double quote, and \\ becomes a single backslash. This is the reverse of the escape operation.

This tool defaults to Unescape mode but also supports Escape mode. Toggle between them at the top. Processing runs entirely in your browser; nothing is sent to a server.

How to Use This Tool

1

Paste Escaped Input

Paste your escaped JavaScript string into the left editor. The tool is in Unescape mode by default. Use Sample to load an example.

2

View Output

The right panel shows the unescaped result automatically. Toggle to Escape mode if you need to go the other direction.

3

Copy Result

Use <strong>Copy</strong> or <strong>Download</strong> to get the result. To switch to escape mode, try JavaScript Escape.

JavaScript Unescape Examples

Unescaping converts escape sequences back into real characters. Example:

Escaped input

Input

Unescaped output (real characters)

Output

When Unescaping Matters

When you receive escaped JavaScript strings from logs, database dumps, serialized code, or API responses, you need to unescape them to read or process the actual content. For example, a log entry might show Hello\nWorld when the real data has a newline between "Hello" and "World".

For HTML-specific unescaping (e.g. <code>&amp;amp;</code> → <code>&amp;</code>), use HTML Unescape. For JSON-specific unescaping, use the JSON Escape tool in Unescape mode.

Frequently Asked Questions

What escape sequences are handled?

This tool handles: \n → newline, \r → carriage return, \t → tab, \0 → null, \v → vertical tab, \f → form feed, \\ → backslash, \' → single quote, \" → double quote.

How is this different from JSON Unescape?

JSON unescape handles JSON-specific sequences (e.g. \uXXXX unicode, \/ forward slash). JavaScript unescape handles JS string literals including single quotes (\') and additional control sequences.

Is my data sent anywhere?

No. Processing runs entirely in your browser.

What if the input has partial or malformed escape sequences?

Unrecognized sequences (e.g. \q) are left as-is. The tool processes only the known sequences listed above.

Can I switch to Escape mode?

Yes. Use the Escape button at the top of the input panel to switch to escape mode.

Related Tools

JavaScript string escape sequences are defined in the ECMAScript specification. MDN String documentation covers string literals and escape sequences.