Forum Discussion
Max
6 months agoSpecialist
Hey! You can use a simple JSON formatter or do it directly in your Python script.
Here one simple example:
import json
# JSON string
json_string = '{"name": "John", "age": 30, "city": "New York"}'
# Convert JSON string to Python dictionary
data = json.loads(json_string)
# Convert Python dictionary back to JSON string with indentation
formatted_json = json.dumps(data, indent=4)
print(formatted_json)
Related Content
- 12 months ago