JSON / JsonPath Validator
The JSON / JsonPath Validator lets you test JsonPath expressions against a JSON document, format JSON with syntax error highlighting, and auto-generate JsonPath from the cursor position.
:::info Screenshot needed — light/dark 📸
json-jsonpath-validator-light.png and json-jsonpath-validator-dark.png — Full view with JSON document on left, JsonPath and results on right
:::
Interface
The tool uses a split-pane layout:
- Left — JSON Document editor (syntax-highlighted) with Load Example and Format Document buttons, and a live
Path:display at the bottom - Right, top — JSON Path input
- Right, bottom — Read-only Result editor
- Bottom — Error message area and the Evaluate button
Live Path Display
As you move the cursor through the JSON document, the current JsonPath is displayed in real-time in the Path: bar at the bottom of the left pane. This is useful for discovering the path to a deeply nested value without manually counting array indices.
Formatting JSON
Click Format Document to pretty-print the JSON with proper indentation. After formatting, code folding is enabled for objects and arrays.
Error Highlighting
If the JSON contains syntax errors, formatting will:
- Still produce a best-effort formatted output
- Display the error line, position, and message in the status bar (for example "JSON Error at Line 3, Position 12: …")
- Highlight the error location with a red squiggly underline in the editor
Hover over the squiggly underline to see the error tooltip.
Evaluating JsonPath
- Paste or type a JSON document in the left editor
- Enter a JsonPath expression in the JSON Path input (for example
$.store.book[*].title,$.users[?(@.age > 30)]) - Click Evaluate
- Results appear in the read-only Result editor as formatted JSON
The expression is validated before evaluation. If the path syntax is invalid, the message "Invalid JSONPath expression: …" is displayed. If the path is valid but matches nothing, the message "The given Json path does not bring any result." is shown.
Generating JsonPath from Cursor Position
Right-click anywhere in the JSON document to access three context menu actions:
| Action | Behavior |
|---|---|
| Show JSONPath from here | Displays the generated path in a dialog |
| Copy JSONPath to Clipboard | Copies the path to the clipboard |
| Use JSONPath | Inserts the path into the expression input |
See Also
- XML / XPath Validator — equivalent tool for XML
- Regular Expression Tester