Query YAML with jq-style filters

Paste YAML, write a jq/yq-style filter, and get YAML or JSON back instantly. Handles multi-document streams and runs entirely in your browser.

Try:
Query output

Query YAML with jq-style filters in your browser

Paste a YAML document, type a jq/yq-style filter, and get the selected or reshaped result back as YAML or JSON. The tool uses the same pure-Rust jaq engine as the JSON jq tool, but parses YAML first, so common config workflows work in one step: read docker-compose ports, list Kubernetes container images, filter CI jobs, or convert a YAML projection to compact JSON for another tool.

Everything runs locally in WebAssembly. No YAML is uploaded, and there is no server-side jq or yq process.

Worked examples

Limits and edge cases

FAQ

Is this the same as yq?

It covers the browser-safe query and transform path: YAML is parsed to a jq data tree, a jq-style filter runs, and the result is emitted as YAML or JSON. It does not edit files in place or preserve comments, so use it for selection, projection, filtering, aggregation, and conversion rather than source-preserving rewrites.

How do I query a multi-document Kubernetes YAML stream?

Leave Documents as each to run the filter independently on every --- document. Choose slurp when the filter needs to see all documents at once, for example map(.metadata.name) or map(select(.kind == "Service")).

Why did I get several output values?

jq filters produce a stream. A filter like .items[] | .name emits one value per item. Wrap the filter in brackets, such as [.items[] | .name], when you want a single array result instead.

Does this preserve YAML comments and anchors?

Anchors, aliases, merge keys, and tags are resolved before querying, so their data is visible to the filter. Comments and original formatting are not preserved in transformed output; the result is newly serialized YAML or JSON.

Developer & Automation Access

Run it from the terminal

Same engine as this page, headless — via the gizza CLI:

gizza tool yaml-query 'services:
  web:
    image: nginx:1.27
    ports:
      - "80:80"
      - "443:443"' 'query=.services.web.ports'

New to the CLI? Get gizza →

Open it by URL

Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:

https://gizza.ai/tools/yaml-query/?yaml=services%3A%0A%20%20web%3A%0A%20%20%20%20image%3A%20nginx%3A1.27%0A%20%20%20%20ports%3A%0A%20%20%20%20%20%20-%20%2280%3A80%22%0A%20%20%20%20%20%20-%20%22443%3A443%22&query=.services.web.ports&input_format=auto&output_format=yaml&documents=each&pretty=true&raw_output=true

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.