About Python JSON Formatter
Python JSON Formatter is a browser tool for inspecting Python-like data copied from a log, debugger, or terminal. It converts supported representations into JSON, displays nested values, and compares documents. You can use it without an account.
What happens to a paste
A parser written for this site reads a supported subset of Python-like syntax in your browser. It does not run Python, import modules, or execute pasted expressions. Conversion, the JSON Viewer, and the Diff Checker run in the page. The last five conversions are saved in this browser; see Privacy for storage and contact-form details.
What conversion changes
The converter maps booleans and null values to JSON syntax, turns tuples and supported set representations into arrays, and recognizes certain positional datetime representations as strings. These are interpretation rules, not a complete Python runtime.
- JSON arrays do not preserve whether an input was a tuple, list, or set. Converting back cannot recover that distinction.
- Supported datetime representations produce strings without adding a timezone. Calls containing
tzinfo=are not supported; serialize those values in Python first. - Numbers are processed as JavaScript numbers. Keep large identifiers and exact decimal amounts as strings when precision matters.
- The JSON-to-Python mode recognizes some date-shaped strings as date or datetime representations. Review the result if those strings were intended as plain text.
- It does not resolve variables or arbitrary objects such as
Decimal(...), NumPy scalars, or custom classes.
For data exchanged by programs, prefer explicit serialization in the producing application. The browser tool is useful for inspecting a copied representation; it cannot infer the original application's schema.
How to use the guides
The guides separate Python standard-library recipes from this converter's behavior. Linked examples load a fixed sample into the editor so you can change it and compare the result. Dates on guides indicate content revisions; the update log records changes across the project.
Contact and corrections
The project publishes under the Python JSON Formatter name. Use the contact form to report an incorrect result, an unclear explanation, or a missing case. Include the page address, a small synthetic example, the expected result, and your browser. Remove credentials and personal data before sending a report.
Updated .