OpenAPI Converter

Convert OpenAPI JSON to YAML and back, or generate a minimal OpenAPI 3.1 skeleton, in the browser.

  • Runs locally in your browser
  • No upload required

Try it

Paste JSON or YAML. It is converted in your browser and never uploaded.

Result
openapi: 3.1.0 info: title: Items API version: 1.0.0 paths: /items: get: responses: '200': description: ok
Valid
yes
openapi: 3.1.0
info:
  title: Items API
  version: 1.0.0
paths:
  /items:
    get:
      responses:
        '200':
          description: ok

Supported formats

Input
text, select
Output
text

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

Converted the document json to yaml (66 character(s)).

How it works

  • Parsed the input with the JSON↔YAML engine, which rejects anchors, aliases and multi-document streams.
  • Emitted YAML 1.2 block style with scalars quoted where needed.
  • The result round-trips through the opposite direction without a semantic change.
  • Everything is computed in the browser; the document is never uploaded.

Methodology

  1. For json-to-yaml, parse the JSON with the verbatim scanner and emit YAML 1.2 block style.
  2. For yaml-to-json, parse the YAML core schema and emit JSON, reporting lossy scalar steps.
  3. For skeleton, build an OpenAPI 3.1 document with an info block, one server and one example operation.
  4. Return the result with any warning notes; never throw for a rejected document.

Usage

  1. Choose JSON to YAML, YAML to JSON, or skeleton.
  2. Paste the document for a conversion, or set the title and version for a skeleton.
  3. Copy the result; check any notes before using it.

Examples

These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.

OpenAPI JSON to YAML

jsonSelect to copy
{
  "text": "{\"openapi\":\"3.1.0\",\"info\":{\"title\":\"Items API\",\"version\":\"1.0.0\"},\"paths\":{}}",
  "mode": "json-to-yaml",
  "title": "",
  "apiVersion": ""
}

Generate a skeleton

jsonSelect to copy
{
  "text": "",
  "mode": "skeleton",
  "title": "Inventory API",
  "apiVersion": "0.1.0"
}

Limitations

Format is a presentation choice

OpenAPI documents are the same data whether written as JSON or YAML. JSON is strict and easy to diff mechanically; YAML is easier to hand-edit and is common in repositories. Converting between them changes only the serialization, so the API description is unchanged.

A skeleton, not a specification

The generated document is deliberately minimal: one server, one path, one response. It exists to give you a valid starting point that tooling accepts, not to infer your API's resources. Replace the example path and responses with your real ones.

Frequently asked questions

Does JSON to YAML round-trip exactly?
For JSON-compatible documents the values are preserved. YAML typing can change the spelling of a scalar (for example, a quoted number stays a string), and any lossy step is reported as a note.
Is the generated skeleton valid OpenAPI?
Yes. It is an OpenAPI 3.1 document with an info block, a server and one example path with a response, and the OpenAPI Viewer parses it.
Is my document sent anywhere?
No. The conversion and generation happen entirely in your browser; the document is never uploaded, stored or logged.

Sources

  1. OpenAPI Specification 3.1.0 — OpenAPI Initiative
  2. YAML 1.2.2 Specification — YAML Language Development Team