Skip to main content

Best Code Formatting Tools in 2026: Prettier vs Biome vs dprint

·PkgPulse Team

TL;DR

Prettier for maximum ecosystem compatibility; Biome for speed and combined lint+format. Prettier (~45M weekly downloads) is the established standard — every editor supports it, every config works. Biome (~1.5M downloads, growing fast) is 10-35x faster, written in Rust, and combines formatting + linting in one tool. dprint (~200K) is the fastest formatter and most configurable but has the smallest ecosystem. For new projects in 2026, Biome is compelling; for existing projects, Prettier is the safe choice.

Key Takeaways

  • Prettier: ~45M weekly downloads — universal adoption, 2-language support, every editor plugin
  • Biome: ~1.5M downloads — 10-35x faster, Rust-based, lint + format combined
  • dprint: ~200K downloads — fastest, WASM plugins, most configurable
  • Biome — compatible with most Prettier configs via biome migrate prettier
  • ESLint + Prettier — still common combo but Biome replaces both

Prettier (The Standard)

// .prettierrc — config
{
  "semi": true,
  "singleQuote": true,
  "printWidth": 100,
  "tabWidth": 2,
  "useTabs": false,
  "trailingComma": "all",
  "bracketSpacing": true,
  "arrowParens": "always",
  "endOfLine": "lf",
  "overrides": [
    {
      "files": "*.json",
      "options": { "printWidth": 80 }
    }
  ]
}
# .prettierignore
node_modules
dist
.next
.cache
coverage
*.min.js
# Prettier CLI commands
prettier --write "src/**/*.{ts,tsx,js,jsx,json,css,md}"
prettier --check "src/**/*.{ts,tsx}"     # CI check (fails if not formatted)
prettier --write .                        # Format everything

# With package.json scripts
# "format": "prettier --write .",
# "format:check": "prettier --check ."
// package.json — Husky + lint-staged integration
{
  "lint-staged": {
    "*.{ts,tsx,js,jsx}": ["eslint --fix", "prettier --write"],
    "*.{json,css,md}": ["prettier --write"]
  }
}

Biome (Speed + Lint)

// biome.json — combines ESLint + Prettier replacement
{
  "$schema": "https://biomejs.dev/schemas/1.9.0/schema.json",
  "organizeImports": { "enabled": true },
  "formatter": {
    "enabled": true,
    "indentStyle": "space",
    "indentWidth": 2,
    "lineWidth": 100,
    "lineEnding": "lf"
  },
  "javascript": {
    "formatter": {
      "quoteStyle": "single",
      "trailingCommas": "all",
      "semicolons": "always",
      "arrowParentheses": "always"
    }
  },
  "linter": {
    "enabled": true,
    "rules": {
      "recommended": true,
      "correctness": {
        "noUnusedVariables": "error"
      },
      "style": {
        "noNonNullAssertion": "warn"
      },
      "suspicious": {
        "noExplicitAny": "warn"
      }
    }
  },
  "files": {
    "ignore": ["node_modules", "dist", ".next", "coverage"]
  }
}
# Biome commands
biome format --write .            # Format all files
biome check --write .             # Lint + format + organize imports
biome lint .                      # Lint only
biome ci .                        # CI check (no writes, fails on issues)

# Migrate from Prettier
biome migrate prettier --write    # Import .prettierrc settings

# Speed comparison (same codebase):
# Prettier: 2.3s
# Biome:    0.07s  (33x faster!)
# VS Code setup — install Biome extension
# .vscode/settings.json
{
  "editor.defaultFormatter": "biomejs.biome",
  "editor.formatOnSave": true,
  "[javascript]": { "editor.defaultFormatter": "biomejs.biome" },
  "[typescript]": { "editor.defaultFormatter": "biomejs.biome" },
  "[typescriptreact]": { "editor.defaultFormatter": "biomejs.biome" }
}

dprint (Fastest)

// dprint.json — plugin-based config
{
  "incremental": true,
  "typescript": {
    "lineWidth": 100,
    "indentWidth": 2,
    "useTabs": false,
    "singleQuotes": true,
    "quoteStyle": "preferSingle",
    "trailingCommas": "onlyMultiLine",
    "semicolons": "always"
  },
  "json": {
    "lineWidth": 80,
    "indentWidth": 2
  },
  "markdown": {
    "lineWidth": 80
  },
  "plugins": [
    "https://plugins.dprint.dev/typescript-0.93.0.wasm",
    "https://plugins.dprint.dev/json-0.19.4.wasm",
    "https://plugins.dprint.dev/markdown-0.17.8.wasm",
    "https://plugins.dprint.dev/toml-0.6.2.wasm"
  ]
}
# dprint commands
dprint fmt                 # Format all files
dprint check               # Check without writing (CI)
dprint fmt --diff          # Show what would change

# Speed: fastest formatter available
# Prettier: 2.3s | Biome: 0.07s | dprint: 0.04s

Speed Benchmark

ToolFormat 1000 filesLanguage SupportLintType-aware
Prettier2-5s20+ languages
Biome0.05-0.1sJS/TS/JSON/CSS
dprint0.03-0.08sVia plugins
ESLint + Prettier4-15sJS/TS✅ optional

When to Choose

ScenarioPick
Established project, max compatibilityPrettier
New project, want speed + lintBiome
Monorepo with huge file countBiome or dprint
Need type-aware lintingESLint (or Biome + ESLint for type checks)
Non-JS files (Go, Rust, Python)Prettier (for JS) + lang-specific tools
Migrating from PrettierBiome (biome migrate prettier)
CI speed is criticalBiome or dprint

Compare formatter package health on PkgPulse.

Comments

Stay Updated

Get the latest package insights, npm trends, and tooling tips delivered to your inbox.