Use Prettier Config Generator

Enter your data below to use the Prettier Config Generator

📌 Try these examples:
RESULT

Last updated

Key Prettier Options Reference

Examples

Example 1: Standard .prettierrc Configuration

{
  "printWidth": 80,
  "tabWidth": 2,
  "useTabs": false,
  "semi": true,
  "singleQuote": false,
  "quoteProps": "as-needed",
  "jsxSingleQuote": false,
  "trailingComma": "es5",
  "bracketSpacing": true,
  "bracketSameLine": false,
  "arrowParens": "always",
  "endOfLine": "lf"
}

Example 2: JavaScript/TypeScript Team Preferences

// .prettierrc.js — JavaScript format with comments
module.exports = {
  // Wrap lines at 100 characters (wider screens)
  printWidth: 100,

  // 2 spaces for indentation
  tabWidth: 2,
  useTabs: false,

  // No semicolons (common in modern JS style)
  semi: false,

  // Single quotes for strings
  singleQuote: true,

  // Trailing commas in all multi-line structures
  trailingComma: "all",

  // Spaces inside object braces: { foo: bar }
  bracketSpacing: true,

  // Arrow functions always have parens: (x) => x
  arrowParens: "always",

  // Unix line endings
  endOfLine: "lf"
};

Example 3: Code Preview — Before and After Formatting

With singleQuote: true, semi: false, trailingComma: "all":

// Before Prettier:
const user = {name: "Alice", age: 30, role: "admin"};
const greet = (name) => {
  return "Hello, " + name
}
import {useState, useEffect, useCallback} from "react"

// After Prettier:
const user = { name: 'Alice', age: 30, role: 'admin' }
const greet = (name) => {
  return 'Hello, ' + name
}
import { useState, useEffect, useCallback } from 'react'

Frequently Asked Questions

Simply enter your data, click the process button, and get instant results. All processing happens in your browser for maximum privacy and security.

Yes! Prettier Config Generator is completely free to use with no registration required. All processing is done client-side in your browser.

Absolutely! All processing happens locally in your browser. Your data never leaves your device, ensuring complete privacy and security.