It looks like your browser language isn't English. Would you like to switch to the Traditional Chinese version? 切換到繁體中文 ×

JSON String Encode / Decode

security Security & Privacy Guarantee

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.

Both are checked to match PHP's json_encode() default behavior. Uncheck "Escape Unicode" to match JSON_UNESCAPED_UNICODE, or "Escape Slashes" to match JSON_UNESCAPED_SLASHES. These only affect Encode — Decode always parses standard JSON regardless of these settings.

Result

Waiting for input...

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.

Done