JSON String Encode / Decode
Built for developers, this tool runs 100% locally in your browser. Your text never leaves your device — there is no backend database, keeping every test fully compliant with data-security best practices.
Result
FAQ
Q: Why does PHP's json_encode() output \u4e2d\u6587 instead of the actual Chinese characters, and how do I stop that?
A: By default, json_encode() escapes every non-ASCII character (Chinese, Japanese, Korean, emoji...) as a \uXXXX sequence. Passing the JSON_UNESCAPED_UNICODE flag keeps them as raw UTF-8 text instead. Uncheck "Escape Unicode" above to preview that behavior.
Q: Why does PHP escape forward slashes as \/ in JSON output?
A: By default, json_encode() escapes / as \/, historically so JSON containing a URL could be safely embedded inside an HTML <script> tag without accidentally matching a closing </script> sequence. Passing JSON_UNESCAPED_SLASHES disables this. Uncheck "Escape Slashes" above to preview that behavior.