Python Escape string Online
Escape quotes/slashes helper.
Run details
The output updates as you type. The tool processes input in your browser.
Worked example
This demo adds backslash escapes to quotes, backslashes, and zero bytes. Use the escaping API for the destination format or protocol when emitting data.
John's "note"
John\'s \"note\"
Using this operation in Python
The interactive result uses JavaScript. Python str stores Unicode text. Encode to bytes when an API expects UTF-8 or another byte representation.