Skip to main content
CuteJSON
↑↓ Navigate Enter Select Esc Close

Query Workbench

Write a JSONPath or JMESPath query, pick the language you meant, and see exactly what it computes.

Back to all tools

Keyboard shortcuts

These work wherever the matching action exists on this page.

Open the command palette
Ctrl/Cmd + K
Run the main action
Ctrl/Cmd + Enter
Format
Ctrl/Cmd + Shift + F
Minify
Ctrl/Cmd + Shift + M
Copy output
Ctrl/Cmd + Shift + C
Open file
Ctrl/Cmd + Shift + O
Download output
Ctrl/Cmd + S
Close this dialog
Esc
Open this dialog
F1 / ?

Local data

Everything below is stored only in this browser, on this device. None of it is ever sent anywhere, and closing this dialog is not required for that to stay true.

Unsaved drafts
Tools with remembered options

Recently opened files

    No files opened yet on this device.

    Share via link

    The content is packed into the part of the link after the # sign, which browsers never send to a server. Nothing here is uploaded to cutejson.com or anywhere else.

    Shares the first input on this page. On a tool with more than one, only that one is included.

    Nothing to share yet. Paste or type something first.

    Examples

    Input

    Load from a URL

    Fetches the URL directly from your browser and loads whatever text it returns into this pane.

    Result

    The result appears here.

    Runs entirely in your browser. Nothing you paste is uploaded, and you can confirm that in your browser Network tab.

    About this tool

    JSONPath and JMESPath answer different questions, so this tool never guesses which one a query is written in, the switch above the query box picks the language. JSONPath finds locations inside a document: every match keeps the shape it already had. JMESPath computes a new value instead: a pipe, a multi-select or a function call can reshape the data into something the document never literally contained, a list of just the fields you asked for, a single number, a document sorted by a field that only appears buried three levels down. This page implements the whole JMESPath 1.0 language, including every function in its standard library, listed below. It does not implement JSONata or jq-style expressions, both of which are their own considerably larger languages, and says so rather than quietly falling back to something else. The JSONPath mode reuses the same engine as the dedicated JSONPath Tester on this site; reach for that tool instead when you want to click a match and see it highlighted inside your document, since this page always prints a computed result rather than a browsable list of locations.

    How to use

    1. Paste your JSON into the editor, or load the sample.
    2. Choose JSONPath or JMESPath, then write a query or press one of the examples.
    3. Read the result on the right. A JMESPath query computes a new value; a JSONPath query lists every match.

    JMESPath functions

    The whole standard library, the same 25 functions the specification defines.

    abs(number) Absolute value.
    avg(array) Average of the numbers, null if empty.
    ceil(number) Rounds up.
    contains(subject, value) True if the string or array contains it.
    ends_with(string, suffix) True if the string ends with it.
    floor(number) Rounds down.
    join(glue, array) Joins strings with a separator.
    keys(object) The object's own keys.
    length(value) Character, element or key count.
    map(&expr, array) Applies an expression to every element.
    max(array) The largest value, null if empty.
    max_by(array, &expr) The element with the largest computed value.
    merge(object, ...) Shallow merges objects, left to right.
    min(array) The smallest value, null if empty.
    min_by(array, &expr) The element with the smallest computed value.
    not_null(value, ...) The first argument that is not null.
    reverse(value) Reverses a string or an array.
    sort(array) Sorts numbers or strings, ascending.
    sort_by(array, &expr) Sorts by a computed value, stably.
    starts_with(string, prefix) True if the string starts with it.
    sum(array) Adds up the numbers.
    to_array(value) Wraps a non-array in one, keeps an array as is.
    to_string(value) The value as a string.
    to_number(value) The value as a number, null if it cannot be read as one.
    type(value) The JMESPath type name.
    values(object) The object's own values.

    Need the full JSONPath syntax table, or want to click a match to see it highlighted in your document? Use the dedicated JSONPath Tester instead.