Updates

Oxc speeds up JSON formatting by moving logic to Rust AST printer

Oxc pushed a narrow JSON hot path into Rust, cutting formatter overhead while keeping Prettier-compatible behavior and broad config support.

Jamie Taylor··2 min read
Published
Listen to this article0:00 min
Oxc speeds up JSON formatting by moving logic to Rust AST printer
Photo illustration

Oxc found a fast way to remove one of the formatter’s most expensive bottlenecks: it moved JSON formatting logic into the Rust AST printer, trimming JavaScript interop overhead without giving up compatibility. For a toolchain built to keep a Prettier-like workflow intact, that is the kind of change that matters immediately in large repositories and CI runs.

The formatter, Oxfmt, sits inside Oxc, the Rust-based JavaScript and TypeScript toolchain from VoidZero. Oxc describes the formatter as Prettier-compatible and built on the same core ideas, but with a document model influenced by Prettier and Biome, Wadler-style pretty printing, and AST integration that can lean on Oxc’s fast parser. JSON was a natural target for the Rust-side optimization because Oxc already treats it as a first-class supported format, alongside JSONC and JSON5, and because formatting that path in Rust avoids extra back-and-forth between JavaScript and native code.

AI-generated illustration
AI-generated illustration

Oxfmt reached beta on February 23, 2026, and Oxc said the formatter was more than 30 times faster than Prettier and three times faster than Biome on an initial run without caching. The team also said Oxfmt passed 100% of Prettier’s JavaScript and TypeScript conformance tests, which gives the speedup more weight than a raw benchmark alone. Compatibility remains central, though not absolute: Oxfmt is closest to Prettier v3.8 for many configurations, but it does not support Prettier plugins, and its default printWidth is 100 rather than Prettier’s 80.

The broader package shows how Oxc is thinking about formatter design. Its docs say the tool is aimed at large codebases and CI environments, where throughput and consistency matter as much as familiarity. Since the December alpha release, Oxc says Oxfmt has expanded support for more file formats, embedded language formatting, import sorting, Tailwind CSS support, and a range of stability and compatibility improvements.

Adoption has already spread across some of the ecosystem’s biggest names, including vuejs/core, vercel/turborepo, huggingface/huggingface.js, and getsentry/sentry-javascript. That matters because Oxc is not pitching Oxfmt as a standalone speed stunt. The formatter is part of a wider toolchain strategy, either as a dedicated replacement or as one piece of a unified Rust workflow.

For Rust tool authors, the message is clear: the best rewrite target is not always the whole product. Sometimes it is the narrow, high-cost path that burns time every time a file is formatted. Oxc’s JSON move shows how a focused Rust implementation can cut that overhead while keeping the rest of the workflow recognizable.

This article was produced by Prism’s automated news system from verified source data, official records, and press releases, then run through automated quality and moderation checks before publishing. The system is built and supervised by the people who set the standards it runs under. Read our full AI policy.

Did this article answer your question?

Discussion

More Rust Programming News