Escape for JSON and Javascript online tool

This tool lets you convert a normal string including newlines, quotes and unicode characters into a quoted string literal ready to use in your JSON or Javascript source. hide

You neeed Javascript enabled in your browser for this to work.

© Public Domain. NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. Created 2011 by Bernhard Häussner. Escaping code borrowed from Douglas Crockford's JSON-js.

Normal:

Escaped & quoted: