HappyFormatter is a privacy-focused browser toolkit for formatting, minifying, inspecting, converting, and repairing developer snippets. It supports 39 formatter languages, 9 minifier targets, 29 utility tools, and SEO-focused workflow pages. Formatting and utility actions run locally in the browser, so pasted code stays on the user's device.
- Production app: Homepage-first local editor with fast textarea fallback while Monaco loads.
- Editor: Modern Monaco editor with Shiki grammars/themes, client-side models, and lazy language/theme loading.
- Homepage: Workflow, FAQ, directory, quick actions, and deferred editor startup are live.
- Examples: Formatter/minifier examples are statically highlighted with Shiki.
- Analytics: Small inline analytics shim with async GA loading. Partytown was removed to avoid worker/bootstrap overhead for one GA script.
- OG images: Static homepage preview at
public/images/og.png; generated/og/...SVG and PNG routes for languages, tools, guides, errors, and comparisons.
- 39 Formatter Languages: Broad coverage across web, data, runtime, systems, and document formats
- 9 Minifier Targets: JavaScript, TypeScript, CSS, SCSS, HTML, JSON, GraphQL, Shell, and XML
- 29 Utility Tools: JSON tools, converters, encoders/decoders, security utilities, color tools, text tools, time tools, and CSS utilities
- Multiple Formatter Engines: Prettier, Biome, Ruff, Mago, OXC, clang-format, shfmt, dprint, Taplo, Malva, web_fmt, and other WASM formatters
- Zero Data Transmission: Formatting, minification, and utility actions run client-side
- Advanced Code Editor: Powered by modern-monaco with Shiki syntax highlighting
- Fast First Interaction: The homepage editor shows an immediate textarea fallback and upgrades to Monaco shortly after load
- Multiple Editor Themes: GitHub, Dracula, Nord, Material, One Dark, Solarized, Monokai, Vitesse, Catppuccin, and more
- Keyboard Shortcuts: Quick formatting with
Ctrl+Shift+Fand minification withCtrl+Shift+M - SEO Content System: Tool hubs, guide pages, error pages, compare pages, generated metadata, and generated OG assets
- Responsive Design: Fully responsive interface optimized for desktop and mobile devices
- Accessibility: ARIA labels, keyboard navigation, screen reader affordances, and skip links
Web Technologies
- JavaScript (with minification) - Alternatives: Biome and OXC formatters
- TypeScript (with minification) - Alternatives: Biome and OXC formatters
- HTML (with minification)
- CSS (with minification)
- SCSS (with minification)
- Sass
- Less
- Vue
- Svelte
- Astro
- Angular templates
- Handlebars
- Jinja
- Twig
Data, Markup, and Documents
- JSON (with minification)
- JSONC
- JSON5
- XML (with minification)
- YAML
- TOML
- SQL
- GraphQL (with minification)
- Protocol Buffers (
.proto) - Markdown
- MDX
Programming Languages
- Python - Alternative: Ruff formatter
- Go
- Rust
- Shell (with minification)
- PHP - Alternative: Mago formatter
- Java
- Dart
- Lua
- Zig
Systems Languages
- C
- C++
- Objective-C
- Objective-C++
- C#
The following languages support code minification:
- JavaScript
- TypeScript
- CSS
- SCSS
- HTML
- JSON
- GraphQL
- Shell
- XML
HappyFormatter includes 29 local utility tools grouped into 9 categories:
- JSON Tools: viewer, sort keys, diff, JSON to YAML, YAML to JSON, JSON to CSV
- Web Encoding Tools: Base64, URL encoder/decoder, regex tester
- Data Converters: CSV/TSV, CSV to JSON, TOML/JSON, XML to JSON
- Security Utilities: JWT decoder and hash generator
- Color Tools: color converter
- Markup Tools: Markdown preview, Markdown to HTML, HTML entities, SVG optimizer
- Text Utilities: text case, string escape, query string parser, HTTP header parser
- Time Utilities: Unix timestamp converter and cron expression explainer
- CSS Utilities: CSS unit converter
public/images/og.pngis the main 1200x630 repository and homepage preview image.public/images/happyformatter-workbench-reference.pngandpublic/images/happyformatter-tools-reference.pngare reference screenshots for product surfaces./og/[...slug].svgand/og/[...slug].pnggenerate route-specific social cards for the homepage, tool hubs, language pages, guides, errors, and comparison pages.
- Node.js: Version 18 or higher
- Package Manager: pnpm 11
- Clone the repository:
git clone https://github.com/happytoolin/happyformatter.git
cd happyformatter- Install dependencies:
pnpm install- Start the development server:
pnpm dev- Open http://localhost:4321 in your browser.
pnpm build
pnpm preview
pnpm deploypnpm dev # Start development server
pnpm build # Build for production
pnpm preview # Preview production build
pnpm typecheck # TypeScript type checking
pnpm check # Astro checking
pnpm format # Format code with dprint
pnpm deploy # Deploy to Cloudflare Pagessrc/
├── components/
│ ├── playground/ # Formatter workspace, Monaco editor, theme controls
│ ├── tools/ # Utility tool surfaces
│ ├── ui/ # Reusable UI components
│ ├── layout/ # Header, footer, head, layout
│ ├── info/ # Workflow, examples, related tools
│ └── faq/ # FAQ components
├── handlers/
│ ├── formatters/ # Language-specific formatter implementations
│ ├── minifiers/ # Language-specific minifier implementations
│ ├── utils/ # Handler utilities
│ └── interface.ts # Formatter/minifier base classes
├── lib/
│ ├── languages.ts # Language configuration and metadata
│ ├── utility-tools.ts # Local utility tool definitions
│ ├── initialCode.ts # Default code examples per language
│ ├── og-image.ts # Generated OG SVG/PNG card rendering
│ ├── seo-content.ts # Guides, errors, comparisons, and hub content
│ └── utils.ts # General utilities
├── icons/ # SVG icon components
├── pages/ # Astro route pages
└── styles/ # Global CSS styles
public/
└── images/
├── og.png
├── happyformatter-workbench-reference.png
├── happyformatter-tools-reference.png
└── happyformatter-logo-concept.png
- Framework: Astro 6.4.4
- Frontend: React 19.2.7 with TypeScript 6.0.3
- Styling: Tailwind CSS v4.3.0
- Code Editor: modern-monaco with Shiki language grammars and themes
- Syntax Highlighting: Shiki for static examples and editor theme integration
- State Management: Zustand
- Formatters:
@wasm-fmt/*packages for C/C++, Dart, Go, GraphQL, Lua, Python, Shell, SQL, TOML, Web, YAML, Zig, and more- Biome (
@wasm-fmt/biome_fmt) for JavaScript/TypeScript - OXC (
@wasm-fmt/oxc_fmt) for JavaScript/TypeScript - Ruff (
@wasm-fmt/ruff_fmt) for Python - Mago (
@wasm-fmt/mago_fmt) for PHP - Malva (
@wasm-fmt/malva_fmt) for CSS-family syntax - Prettier for JavaScript, TypeScript, JSON, Rust, and PHP paths
- dprint for Markdown
- xml-formatter for XML
- Minifiers:
@swc/wasm-webfor JavaScript/TypeScriptlightningcss-wasmfor CSS/SCSShtml-minifier-terserfor HTML
- Image Generation: SVG/PNG OG routes backed by
sharp - Deployment: Cloudflare Pages
Contributions are welcome. Please test changes thoroughly before opening a pull request.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes and run the checks
- Commit your changes
- Push to the branch
- Open a pull request
- Create a formatter class in
src/handlers/formatters/[language].tsextendingFormatter - Create a minifier class in
src/handlers/minifiers/[language].tsif minification is supported - Add the language configuration to
src/lib/languages.ts - Add a Shiki language loader in
src/components/playground/CodePlayground.tsx - Add a default code sample in
src/lib/initialCode.ts - Update the formatter/minifier index in
src/handlers/index.ts - Add SEO variant content if the language needs alternate route families
This project is licensed under the GPL-3.0 License. See the LICENSE file for details.
- Astro - Static site framework
- Monaco Editor and modern-monaco - Browser editor runtime
- Shiki - Syntax highlighting and editor themes
- WebAssembly formatters and minifiers from the open-source community
HappyFormatter - Format your code, keep it private.

