Anúncios incomodam? Ir Sem anúncios Hoje

Solidity Code Formatter

Desenvolvedor
ANUNCIADO Remover?

Style Options

Used when normalising or inserting a missing pragma.
Long argument lists are wrapped to fit within this width.
ANUNCIADO Remover?

Guia

Solidity Code Formatter

Solidity Code Formatter

Paste your Solidity smart contract source and get back clean, style-guide-compliant code in the browser — no installs, no Hardhat config, no remote compilation. The formatter reorders function modifiers, sorts pragmas and imports, normalises NatSpec comments, and applies consistent indentation so the output is ready for review or audit hand-off.

Como usar

  1. Paste your Solidity (.sol) source into the input box, or click Tente um exemplo for a starter contract.
  2. Pick an indentation width (4 spaces by default, matching the official style guide), brace placement, and column limit.
  3. Decide whether to reorder function modifiers, sort pragma and import lines, and normalise NatSpec comments. All three are on by default.
  4. If you want the formatter to enforce a specific compiler version, switch the Solidity Version dropdown away from Keep existing pragma.
  5. The formatted code appears on the right with syntax highlighting; use the copy or download buttons to take it back into your project.

Características

  • Style-guide indentation — 4 spaces, 2 spaces, or tabs.
  • K&R or Allman brace placement — opening brace on the same line (default) or the next line.
  • Modifier ordering — visibility (public, external, internal, private) → mutability (pure, view, payable) → virtualoverride, with custom modifiers preserved after the standard ones.
  • Pragma and import sorting — pragmas first, then imports ordered alphabetically by quoted path.
  • Solidity version selector — keep the existing pragma or normalise to a recent 0.8.x release.
  • NatSpec normalisation/// e /** */ blocks get a single space after the slashes and consistent * alignment.
  • Long-line wrapping — long argument lists are wrapped at the column limit you specify (40–200, default 120).
  • Executa inteiramente no navegador — your contract source never leaves your machine.

Perguntas frequentes

Quer eliminar anúncios? Fique sem anúncios hoje mesmo

Instale nossas extensões

Adicione ferramentas de IO ao seu navegador favorito para acesso instantâneo e pesquisa mais rápida

Ao Extensão do Chrome Ao Extensão de Borda Ao Extensão Firefox Ao Extensão Opera

O placar chegou!

Placar é uma forma divertida de acompanhar seus jogos, todos os dados são armazenados em seu navegador. Mais recursos serão lançados em breve!

ANUNCIADO Remover?
ANUNCIADO Remover?
ANUNCIADO Remover?

Notícias com destaques técnicos

Envolver-se

Ajude-nos a continuar fornecendo ferramentas gratuitas valiosas

Compre-me um café
ANUNCIADO Remover?