SQL Unescape

Unescape SQL strings back to plain text.

Local Your input is processed locally in your browser. Found a problem? Report an issue

What SQL Unescape does

SQL Unescape reverses SQL escaping, turning escape sequences back into the characters they stand for, so you can read text copied from source code, logs or data files.

SQL Unescape examples

The built-in sample

Input

It''s the user''s choice

Output

It's the user's choice

This is the input that the Load sample button fills in.

Doubled apostrophes

Input

O''Brien''s order

Output

O'Brien's order

Each pair of single quotes becomes one.

A value copied with its quotes

Input

'It''s 5 o''clock'

Output

'It's 5 o'clock'

The opening and closing quote of the literal are not removed: paste only what is between them.

Each output was produced by running this tool on the input above it.

How it works

Unescaping applies these rules in reverse:

Escaped formCharacter
'''

Details and limits

  • Every pair of single quotes becomes one. Paste the content of the literal without the quote before and after it; those two are single and are left in place.
  • Backslash escapes such as \' or \n, which MySQL accepts, are not decoded.
  • Prefixes that some databases put before a literal, such as N'...' for Unicode strings in SQL Server or E'...' for escape strings in PostgreSQL, are not understood. Remove the prefix together with the quotes.
  • The typical use is reading values out of a database dump or a logged INSERT statement, where every apostrophe in the data appears twice.

Questions

Is my data uploaded when I use SQL Unescape?

No. The tool runs in your browser, so what you paste or open is processed on your own device and is not sent to a server.

What does SQL Unescape do?

SQL Unescape reverses SQL escaping, turning escape sequences back into the characters they stand for, so you can read text copied from source code, logs or data files.

Are there any limits I should know about?

Every pair of single quotes becomes one. Paste the content of the literal without the quote before and after it; those two are single and are left in place. Backslash escapes such as \' or \n, which MySQL accepts, are not decoded.

Is there a size limit?

There is no fixed size limit. Everything happens on your device, so very large inputs depend on its memory and can take longer on a phone than on a computer.

Does it work on phones, and is it free?

Yes. It works in any current browser on Android phones, iPhones, tablets and computers. It is free and needs no account or sign-up.