If you haven't check jsonschema library, it can be useful to validate data. JSON Schema is a way to describe the content of JSON. The library just uses the format to make validations based on the given schema.

I made a simple example from basic usage.

import json
from jsonschema import validate

# Describe what kind of json you expect.
schema = {
    "type" : "object",
    "properties" : {
        "description" : {"type" : "string"},
        "status" : {"type" : "boolean"},
        "value_a" : {"type" : "number"},
        "value_b" : {"type" : "number"},
    },
}

# Convert json to python object.
my_json = json.loads('{"description": "Hello world!", "status": true, "value_a": 1, "value_b": 3.14}')

# Validate will raise exception if given json is not
# what is described in schema.
validate(instance=my_json, schema=schema)

# print for debug
print(my_json)
Answer from T.Nylund on Stack Overflow
🌐
JSON Formatter
jsonformatter.org
Best JSON Formatter and JSON Validator: Online JSON Formatter
Validate JSON using PHP · Python Load Json From File · Online JSON Formatter and Online JSON Validator provide JSON converter tools to convert JSON to XML, JSON to CSV, and JSON to YAML also JSON Editor, JSONLint, JSON Checker, and JSON Cleaner. Free JSON Formatting Online and JSON Validator work well in Windows, Mac, Linux, Chrome, Firefox, Safari, and Edge.
JSON Parser
Secure JSON Parser is an online JSON Parser tool to Parse, Decode and Visualize JSON data in Tree view. JSON Parser online updated in 2022.
JSBeautifier
Online JS Beautifier helps to Beautify Javascript. This Javascript Beautifier helps to unminify, Save and Share Javascript.
XML Formatter
Online XML Formatter will format xml data, helps to validate, and works as XML Converter. Save and Share XML.
Best JSON Pretty Print Online
Best JSON Pretty Print tool to Make Pretty JSON and JSON Print in color and Save and Share Online.
🌐
JSON Formatter
jsonformatter.curiousconcept.com
JSON Formatter & Validator
To learn more about JSON check out some of the following links. ... Install the JSON Formatter & Validator Bookmarklet to quickly and easily format and validate any public JSON URL with a single click.
🌐
JSONLint
jsonlint.com
JSONLint - The JSON Validator
It's an excellent way to correct errors without wasting hours finding a missing coma somewhere inside your code. JSONLint is an online editor, validator, and formatting tool for JSON, which allows you to directly type your code, copy and paste it, or input a URL containing your code.
🌐
Flexiple
flexiple.com › python › python-json-validator
Python JSON Validator - Flexiple
The JSON Validator is straightforward to use. We will demonstrate how to validate JSON data step-by-step. To get started, import the JSON module into your Python script:
🌐
jsonschema
python-jsonschema.readthedocs.io › en › latest › validate
Schema Validation - jsonschema 4.26.1.dev25+gad0a1b301 documentation
The Basics: The simplest way to validate an instance under a given schema is to use the validate function. The Validator Protocol: jsonschema defines a protocol that all validator classes adhere to...
🌐
PyPI
pypi.org › project › json-checker
json-checker · PyPI
json_checker is a library for validating Python data structures, such as those obtained from JSON (or something else) to Python data-types.
      » pip install json-checker
    
Published   Aug 31, 2019
Version   2.0.0
🌐
JSON Formatter
jsonformatter.org › c47f9c
python
JSON Validator Online checks the integrity/syntax of the JSON data based on JavaScript Object Notation (JSON) Data Interchange Format Specifications (RFC).
Find elsewhere
🌐
Code Beautify
codebeautify.org › jsonvalidator
JSON Validator - JSONLint tool to validate JSON data
JSON Validator will show the errors with line numbers, if any, with great details. Know more about JSON. How to Create JSON File? JSON Full Form · What is JSON? JSON Example with JSON Array · Pretty Print JSON using Python · Read JSON File Using Python · Validate JSON using PHP ·
🌐
PYnative
pynative.com › home › python › json › validate json data using python
Validate JSON data using Python
May 14, 2021 - Using jsonschema, we can create a schema of our choice, so every time we can validate the JSON document against this schema, if it passed, we could say that the JSON document is valid. ... First, install jsonschema using pip command. pip install jsonschema · Define Schema: Describe what kind of JSON you expect · Convert JSON to Python Object using json.load or json.loads methods.
🌐
jsonschema
python-jsonschema.readthedocs.io
jsonschema 4.26.0 documentation
>>> validate(instance={"name" : "Eggs", "price" : 34.99}, schema=schema) >>> validate( ... instance={"name" : "Eggs", "price" : "Invalid"}, schema=schema, ... ) Traceback (most recent call last): ... ValidationError: 'Invalid' is not of type 'number' It can also be used from the command line by installing check-jsonschema.
🌐
Built In
builtin.com › software-engineering-perspectives › python-json-schema
How to Use JSON Schema to Validate JSON Documents in Python | Built In
In Python, we can use the jsonschema library to validate a JSON instance (also referred to as a JSON document as long as it’s unambiguous) against a schema.
🌐
GitHub
github.com › python-jsonschema › jsonschema
GitHub - python-jsonschema/jsonschema: An implementation of the JSON Schema specification for Python · GitHub
jsonschema is an implementation of the JSON Schema specification for Python. >>> from jsonschema import validate >>> # A sample schema, like what we'd get from json.load() >>> schema = { ... "type" : "object", ... "properties" : { ... "price" : {"type" : "number"}, ...
Starred by 4.9K users
Forked by 609 users
Languages   Python 99.8% | TypeScript 0.2%
🌐
Pydantic
docs.pydantic.dev › latest › concepts › json
JSON - Pydantic Validation
""" try: return handler(v) except ValidationError as exc: # there might be other types of errors resulting from partial JSON parsing # that you allow here, feel free to customize as needed if all(e['type'] == 'missing' for e in exc.errors()): raise pydantic_core.PydanticUseDefault() else: raise class NestedModel(BaseModel): x: int y: str class MyModel(BaseModel): foo: Optional[str] = None bar: Annotated[ Optional[tuple[str, int]], WrapValidator(default_on_error) ] = None nested: Annotated[ Optional[NestedModel], WrapValidator(default_on_error) ] = None m = MyModel.model_validate( pydantic_core
🌐
Couchbase
couchbase.com › home › validate json documents in python using pydantic
Validate JSON Documents in Python using Pydantic
June 14, 2025 - Find out how to validate JSON documents against a specified schema using the popular Python library pydantic. Get validation best practices at Couchbase.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-check-whether-a-string-is-valid-json-or-not
Python | Check whether a string is valid json or not - GeeksforGeeks
July 11, 2025 - In the below example, the string is an invalid JSON because, the string characters are enclosed in single quotes ('), but as per valid JSON schema, strings must be enclosed in double quotes ("). ... # Python code to demonstrate # checking whether string # is valid json or not import json ini_string = "{'akshat' : 1, 'nikhil' : 2}" # printing initial ini_string print ("initial string", ini_string) # checking for string try: json_object = json.loads(ini_string) print ("Is valid json?
🌐
GitHub
github.com › donofden › python-validate-json-schema
GitHub - donofden/python-validate-json-schema: Validate JSON Schema using Python
Currently the most complete and compliant JSON Schema validator available for python is Jsonschema.
Starred by 6 users
Forked by 2 users
Languages   Python 100.0% | Python 100.0%
🌐
PyPI
pypi.org › project › jsonschema
jsonschema · PyPI
Programmatic querying of which properties or items failed validation. jsonschema is available on PyPI.
      » pip install jsonschema
    
Published   Jan 07, 2026
Version   4.26.0
🌐
Donofden
donofden.com › blog › 2020 › 03 › 15 › How-to-Validate-JSON-Schema-using-Python
How to Validate JSON Schema using Python
Currently the most complete and compliant JSON Schema validator available for python is Jsonschema.
🌐
Validatejson
validatejson.com
Online JSON Validator & Formatter – Validate, Parse & Beautify JSON
Free JSON Validator & Formatter online tool. Validate JSON, parse JSON, check JSON online, and beautify JSON with pretty print. Format JSON data instantly.