Skip to content
100% local

LaTeX escape

Escape or unescape the characters LaTeX reserves for markup, so plain text compiles cleanly.

Input

LaTeX escape

LaTeX treats ten characters as markup: # $ % & _ { } ~ ^ and the backslash itself. Paste in a raw string — a filename, a price, a URL, a CSV column — and any of the ten come out escaped, so the document compiles instead of stopping on a "Missing $ inserted" error. Switch the direction to unescape to go the other way, turning a .tex fragment back into plain text.

"Characters to process" controls which of the ten get touched — narrow it to just # $ % if your input already has literal braces you want left alone. "Convert straight quotes" turns "like this" into the `` … '' pairs LaTeX's default fonts expect, and "Convert dashes" rewrites an en dash or em dash pasted from a word processor into -- and ---. "Keep math environments untouched" is on by default: it detects $…$, \[…\] and environments like equation and align, leaving everything inside exactly as written, since escaping a $ or ^ inside real math breaks the formula rather than fixing it.

Accented letters stay as UTF-8 by default, which modern LaTeX handles natively. "Convert to accent commands" rewrites them as classic \'{e}, \v{c}, \H{o} style commands instead, for older setups. "Wrap result in a verbatim environment" drops the output between \begin{verbatim} and \end{verbatim}, and "Warn about unmatched braces" flags an imbalance in the result line without touching the output itself.

Everything runs locally in your browser — nothing you paste here, including unpublished manuscript text, is uploaded anywhere. Copy the result, download it as a .txt file, or send it straight into another tool to keep working.

FAQ

Which characters does this tool escape?
The ten LaTeX reserves for markup: # $ % & _ { } ~ ^ and \. Use the "Characters to process" field to limit it to a subset.
Why is my formula being changed too?
Turn on "Keep math environments untouched" (on by default) — it detects $…$, \[…\], \(…\) and common display environments and leaves their contents exactly as written.
Does unescape always reverse the accent commands?
Yes. Unescape converts recognized accent commands like \'{e} or \v{c} back to their plain UTF-8 letters regardless of the "Accented letters" setting, since that setting only controls what escaping produces.
What does the unmatched-braces warning check?
It counts unbalanced { and } in your raw input and reports the total in the result line — a quick sanity check before you paste the output into a document. It doesn't change the escaped text itself.
Is my text uploaded anywhere?
No. LaTeX escaping runs entirely in your browser — the text you paste never leaves your device.