100% local — your data never leaves your browser

SQL Unescape — Read the Value in a Query

Undo ANSI SQL quoting: drop the enclosing single quotes if present and turn each doubled quote back into one, so you see the value as stored.

Instant Private Zero cookies

SQL Escaped input

Text output

What this tool does

It reverses the one escaping rule standard SQL has for string literals: a single quote inside the string is written twice. Paste the literal and each '' becomes a single '.

If the text is wrapped in single quotes, the enclosing pair is removed first. That makes both forms work — 'O''Brien' and O''Brien both give O'Brien — so you can paste from a query or from a dumped column value without editing it first. Since the escape side wraps its output, the two are exact inverses: anything it produces comes back through this tool unchanged, quote characters included.

When you need it

Reading a literal out of a query log, a migration file or an ORM’s debug output, where the quoting has doubled up and the value is hard to read. Also for checking that a value was escaped once rather than twice: a name that comes back with a stray quote usually went through the escaping step one time too many.

What it does not do

Backslash escapes are not touched. MySQL accepts \' unless NO_BACKSLASH_ESCAPES is set, but that is a MySQL extension rather than standard SQL, and decoding it here would silently rewrite a literal meant for a database that has no such rule.

PostgreSQL’s escape strings (E'...') and dollar quoting ($$...$$) are likewise out of scope, as is a whole query: the tool reads one literal, and collapsing every doubled quote in a statement would destroy the ones belonging to other literals.

Private by design

Everything runs locally in your browser with JavaScript. Your data is never uploaded, which makes the tool safe for sensitive content, and it keeps working offline.

Frequently asked questions

Do I have to include the quotes?
No. Both `'O''Brien'` and `O''Brien` give `O'Brien`. The enclosing pair is removed when it is there and ignored when it is not, so you can paste straight out of a query or out of a column value.
What about MySQL's backslash escapes?
They are left alone. `\'` is a MySQL extension, disabled by the `NO_BACKSLASH_ESCAPES` mode and absent from standard SQL; decoding it would silently change the meaning of a literal written for a database that does not have it.
Can I paste a whole query?
No — one literal at a time. Every doubled quote in the input would be collapsed, including those belonging to other literals, and the result would no longer be runnable SQL.

Related converters