Skip to main content

Ruff Playground: Inspect AST, Tokens, Formatter IR & Config

playground.pyloading Ruff…
168 chars | 9 lines
| Loading the Ruff engine…
Official Ruff 0.16.2 WebAssembly build — diagnostics, formatting, AST, tokens and the formatter IR in your browser. Edit the settings, share a link to your snippet, updates live as you type.

Inspect Ruff diagnostics, AST, tokens and formatter IR

Use this playground when you want to see *how* Ruff reads your code, not just the lint results. Paste Python and inspect the parsed AST, the raw token stream and the formatter's intermediate representation (IR) alongside live ruff check diagnostics and ruff format output — then edit the Ruff config and share a link that reopens your exact code and settings. For a quick one-click lint or format without these internals, use the simpler Ruff Linter & Formatter.

Tool facts

Supported Python
Python 3.7 – 3.14
Input limit
Limited only by your device
Last reviewed
2026-08-25

What it can't do

  • Execute your code — Ruff is a static linter and formatter.
  • Replace a type checker for cross-module type inference.

About Ruff Playground

This is a full, professional-grade playground for Ruff, the extremely fast Rust-based Python linter and formatter from Astral. It updates live as you type: pick a tab to see the lint diagnostics (ruff check), the formatted output (what ruff format would produce), the parsed AST, the raw token stream, the formatter's intermediate representation (IR), or the extracted comments. A light/dark theme toggle keeps the editor comfortable in any lighting.

**How to check Ruff online, step by step:** (1) Paste or type your Python into the editor — syntax highlighting and live linting start immediately. (2) Read the **Diagnostics** tab: each issue shows its rule code (e.g. F401 unused import, E701 multiple statements), line and column, and whether Ruff can auto-fix it. (3) Switch to **Formatted** to see the ruff format output, or **AST** / **Tokens** / **Formatter IR** to inspect how Ruff parses your code. (4) Open **Settings** to edit the Ruff config as JSON — the same fields you'd put under [tool.ruff] in pyproject.toml, including select, ignore, line-length and format.quote-style. (5) Hit **Share** to copy a link that reopens your exact code and settings.

It runs the official Ruff build compiled to WebAssembly (currently Ruff 0.16.2), directly in your browser. For a quick one-click lint or format without the extra AST/tokens/IR views, use the simpler Ruff Linter & Formatter instead.

For a project-level decision, see our Ruff vs Pylint comparison tested on the same code. It shows which of 14 error categories each tool caught, what Ruff fixed automatically, measured CLI timings, and when Pylint's semantic and cross-file analysis still matters.

Frequently Asked Questions

Paste your Python into the editor above — it runs `ruff check` live in your browser and shows every diagnostic with its rule code, line and column, and whether it's auto-fixable. There's nothing to install; it runs the official Ruff WebAssembly build in your browser. Switch tabs to also see the formatted output, AST, tokens and formatter IR.