Shell Arg Escaper
Quote and escape strings safely for bash, sh, PowerShell, and Windows cmd.
Quote shell arguments safely
Shell scripts break when filenames or secrets contain spaces, quotes, or metacharacters. This escaper wraps each argument for bash, POSIX sh, PowerShell, or Windows cmd.exe so you can paste values into commands without accidental word splitting or expansion.
When to escape
Use quoting before passing user-controlled paths to rm, curl, backup tools, or CI steps.
Bash and sh use single-quoted literals with escaped embedded apostrophes; PowerShell doubles single quotes inside
single-quoted strings; cmd wraps arguments in double quotes and escapes % and quotes.
For HTTP debugging rather than shell usage, see the cURL to HTTPie converter and related API snippet tools.
Frequently Asked Questions
Does bash escaping stop variable expansion?
Single-quoted bash strings treat $HOME literally. Use double quotes only when you intentionally need expansion.
Can I escape multiple arguments at once?
Enter one argument per line. The tool shows both a joined command-line string and per-line escaped values.
Is this identical to GNU printf %q?
The bash mode follows common single-quote wrapping used in portable scripts. For exotic locale or ANSI-C quoting, validate against your target shell version.