SQL Unescape
Paste SQL-escaped text to recover the original literal value with doubled single-quotes collapsed back to one.
Example
Doubled single-quotes are collapsed and surrounding quotes removed:
Input: 'It''s a ''test'''
Output: It's a 'test'
How it works
Removes optional surrounding single-quotes, then replaces every doubled single-quote ('') with a single one. Runs live as you type, entirely client-side.
Good to know
SQL Unescape takes a SQL string literal and converts it back into the plain text value it represents. Inside SQL, a literal value is wrapped in single quotes and any apostrophe within it is written as two single-quotes in a row. This tool strips the wrapping quotes and collapses every doubled '' back into one ', so 'It''s a ''test''' becomes It's a 'test'. It is aimed at developers, DBAs, and analysts who copy escaped strings out of query logs, generated SQL, ORM debug output, or error messages and need the real underlying value.
Reach for it when you are debugging a query and want to see what was actually stored or compared, when you are reconstructing a value from a long INSERT or UPDATE statement, or when a logged statement shows a name like O''Brien and you need the human-readable form. Because it runs entirely in your browser and updates live as you type, it is also a quick way to sanity-check escaping before pasting a value somewhere outside of SQL.
The status line reports how many characters the unescaped result contains, which is a useful cross-check: if the count looks too high, your input may still contain doubled quotes that were not part of the literal, or extra surrounding text. The outer single-quotes are only removed when the whole input is a single, properly balanced literal; if quoting is uneven, the tool leaves the wrapping quotes in place and just collapses the doubled ones.
One caveat to keep in mind: this tool follows the ANSI SQL standard, where quotes are escaped only by doubling. It deliberately does not undo backslash-style escapes such as \' or \n that some MySQL configurations allow, because those are non-standard and ambiguous. If your value came from a backslash-escaping dialect, unescape that separately rather than relying on this tool to interpret it.
Frequently asked questions
What exactly does SQL unescaping do?
In SQL string literals a single-quote inside the value is written as two single-quotes (''). This tool reverses that, turning every '' back into a single ' and removing the outer quotes that wrap the literal.
Does it handle backslash escapes like \' ?
No. Standard ANSI SQL escapes quotes only by doubling them, so this tool collapses '' to '. MySQL's optional backslash-escape mode (\') is not reversed, since it is non-standard and ambiguous.
Is my data uploaded anywhere?
No — this tool runs entirely in your browser. Your input never leaves your device and it works offline once loaded.
Is it free?
Yes, completely free with no sign-up and no limits.
People also ask
How do I escape a single quote in SQL?
In standard SQL you escape a single quote inside a string literal by writing it twice. For example, the value O'Brien is written as 'O''Brien' in a query.
Why are there two single quotes in my SQL string?
Doubled single-quotes represent one literal apostrophe inside a SQL string. SQL uses the single quote to delimit the literal, so an actual apostrophe in the data is written as two quotes to avoid ending the string early.
What is the difference between escaping and unescaping a SQL string?
Escaping prepares a raw value for use inside a SQL query by doubling its single quotes and wrapping it in quotes. Unescaping reverses that, turning the literal back into the original plain value, which is what this tool does.
Does this tool prevent SQL injection?
No. It only converts an already-escaped literal back to plain text and is meant for reading and debugging. To prevent SQL injection you should use parameterized queries or a database driver's built-in escaping rather than building queries from strings.
Can I unescape MySQL strings that use backslashes like \' or \n?
Not with this tool. It handles only the ANSI standard of doubled quotes, so backslash escapes are left untouched. You would need a MySQL-aware unescaper for values produced in backslash-escaping mode.
Is it safe to paste production data or sensitive values into this tool?
The tool runs entirely in your browser and does not upload or transmit your input, so the text stays on your device. As always, follow your own organization's data-handling policies for anything confidential.
What happens if my input is not wrapped in single quotes?
The tool still works: it only removes surrounding quotes when the whole input is a single balanced literal. If there are no wrapping quotes, it simply collapses any doubled single-quotes it finds into single ones.
How do I read the original value from a SQL INSERT statement?
Copy the quoted value from the VALUES list and unescape it so the wrapping quotes are removed and doubled quotes become single. The result is the actual value that was inserted into the column.
Related tools