OpenAI Messages Converter

Paste an OpenAI chat messages array, validate roles and content, then output pretty JSON or readable plain text for API debugging.

Read the full guide: The Complete Guide to OpenAI Message Formatting & LLM Data Processing β†’

Privacy: processed locally, never uploaded.

↓ Paste in the input area below to see results instantly

Validate OpenAI messages JSON and output pretty JSON or readable plain text.

Messages JSON

Output

Notes

vs Chat Format Converter

This tool validates and prettifies OpenAI messages; Chat Format Converter exports Anthropic / Gemini shapes.

Paste an OpenAI chat messages array, validate roles and content, then output pretty JSON or readable plain text for API debugging.

Quick start

  1. Paste JSON

    Root array with role and string content per item.

  2. Switch output

    JSON mode prettifies; text mode shows role sections.

Supported roles

system, user, assistant, developer; content must be a string.

Typical Workflow

When debugging OpenAI API conversations, developers often need to inspect the messages array structure. Simply copy-paste the messages object from API requests into this tool to automatically validate role/content fields and output formatted JSON. For long conversations, switch to plain-text mode for quick context reading.

The tool is ideal for testing complex conversation flows. For multi-turn dialogues, use it to check if historical messages contain invalid roles or truncated content. The indented JSON can be directly copied back to code editors, more efficient than viewing compressed text in terminals.

Examples

Example

Input

[{"role":"user","content":"Hi"}]

Output

Pretty JSON or plain text

FAQ

Different from chat format converter?

This validates OpenAI messages; Chat Format Converter exports Anthropic/Gemini shapes.

Why does my JSON show 'Invalid'?

Common causes: 1) Invalid role (not system/user/assistant) 2) Missing content field 3) Missing outer square brackets 4) Contains JavaScript comments. Click error messages to highlight problematic lines – fix and re-paste.