Skip to main content

$ Shell Unescape

Paste a quoted or backslash-escaped string and get back the raw text the shell would see — for bash / sh, Windows cmd and PowerShell. Auto-detects the quoting style, and shows you exactly how the shell splits it into arguments.

✓ 100% client-side — nothing leaves your browser ✓ 5 unescape modes + auto-detect ✓ Honest about ambiguity — flags lossy cases

01 · Unescape a quoted string

02 · Split into arguments (argv view)

How a POSIX shell would split your input into separate arguments — quoted spans stay together, unquoted spaces split. $variables and $(commands) are shown literally: this view never expands or executes anything.

ArgumentValueLength

03 · All five modes side by side

Same input, every mode — the fastest way to see when the quoting style is ambiguous and which readings agree.

ModeDecoded outputvs result

04 · Worked examples

posix-single · the classic splice
in:  'it'\''s'
out: it's
posix-single · hostile mix stays literal
in:  'don'\''t "quote" me $now'
out: don't "quote" me $now
posix-backslash · escaped filename
in:  file\ \(1\).txt
out: file (1).txt
posix-double · escapes decoded, $VAR kept literal
in:  "say \"hi\" $USER"
out: say "hi" $USER
cmd · percent can never expand
in:  "100%%"
out: 100%
cmd · CRT quote convention
in:  "a\"b"
out: a"b
powershell · quote doubling
in:  'it''s'
out: it's
auto-detect · auto-detect, identical under two modes
in:  'plain'
out: plain

Every example above is machine-verified: each output is recomputed by the page's own unescape engine at build time.

05 · Where unescaping is lossy — read this

Unescaping is the reverse of escaping, but not every round trip is perfect. This tool tells you about each of these instead of guessing silently:

CaseWhat happensWhy it's honest
quoted vs unquoted spaceBoth decode to the same space character.The quoting carried the only record of which it was — that record is gone.
$VAR in "..."Shown literally, never expanded.Expansion needs your environment; a web page can't (and mustn't) know it.
$(...) and `...`Shown literally, never executed.Executing pasted commands would be a remote-code-execution hole.
lone % in cmdKept literally + warning.It could be data or a %VAR% reference — only you know.
! in "..." (bash)Decoded as typed.Interactive bash may history-expand ! before any tool sees it; nothing can undo that.
\Lines are joined (continuation).That is what POSIX shells do — the tool mirrors it and says so.

Scope boundary — what this tool is and isn't

✓ This tool

  • Decodes one quoted/escaped string back to raw text (one-way: escaped → plain).
  • Covers POSIX shells (bash, dash, sh, zsh) plus Windows cmd and PowerShell — the same five modes as our Shell Escape tool, in reverse.
  • Shows the argv split so you see token boundaries exactly as the shell would.

✕ Not this tool

  • Not an escaper — to quote raw text for a command, use Shell Escape.
  • Not a shell: it never expands variables and never executes commands.
  • Not a deobfuscator for malware — it decodes quoting, nothing more.

06 · Frequently asked questions

What does this shell unescape tool do?
It reverses shell quoting: paste a quoted or backslash-escaped string and get back the raw text the shell would see — the exact inverse of our Shell Escape tool (/tools/shell-escape/). Five modes cover POSIX single-quote, POSIX backslash, POSIX double-quote, Windows cmd, and PowerShell, plus auto-detect that reads the shape of your input.
Why can't unescaping always recover the exact original string?
Because quoting destroys information: once a space is quoted, nothing records whether that space was originally quoted or was an argument separator — the decoded text is identical either way. The same holds for $HOME inside double quotes: the text could be literal dollars or an unexpanded variable. The tool decodes the text faithfully and flags every ambiguous case in the notes panel instead of guessing silently.
How does auto-detect choose a mode?
By shape: the '\'' splice is the POSIX single-quote idiom, '' doubling is the PowerShell idiom, %% or ^ point to cmd.exe, and backslash escapes point to the POSIX modes. When two modes decode an input identically (for example 'plain' under POSIX single-quote and PowerShell), it tells you so. When the input is genuinely ambiguous it picks the most likely reading, labels its confidence, and you can switch modes to compare all five side by side.
What is the 'split args' view?
It tokenizes your input the way a POSIX shell splits a command line into argv: quoted spans stay together, unquoted spaces split arguments, and backslash escapes resolve. For example, echo 'a b' c becomes three arguments: echo, a b, c. It never expands $variables or runs $(commands) — those appear literally with a warning — so it is safe to inspect even hostile-looking command lines.
Why is $VAR shown literally instead of expanded?
Expansion needs a real environment: $HOME differs between machines, and $(...) would execute code. A web page cannot know your shell's variables, and it must never run pasted commands. So the tool decodes the quoting and shows $VAR exactly as typed, with a note. If you need the expanded value, run printf %s "$VAR" in your own terminal.
When should I use shell-unescape instead of shell-escape?
Use shell-escape when you HAVE raw text and need it safely quoted for a command. Use shell-unescape when you HAVE a quoted or escaped fragment — from a log file, a generated script, or an error message — and need the raw value back, for example to see which filename 'my\ file.txt' really refers to. The two tools are reverse pairs and link to each other.
Is my input sent to a server?
No. This page runs 100 percent in your browser: the unescape engine is plain JavaScript with no network requests, no cookies and no analytics on your input. You can disconnect from the internet and it keeps working. Nothing you paste ever leaves your device.
Shell Unescape · reverse pair of Shell Escape · free online tool · runs 100% in your browser · no input ever leaves your device.

Free tool by NRTechStudio