syntax = "proto3";
message Person {
string name = 1;
int32 id = 2;
repeated string email = 3;
}
About Protobuf Formatter – Beautify & Indent .proto
A Protobuf formatter cleans up `.proto` schema files so every message, enum, service, and oneof block follows the same style. Hand-edited proto files drift over time — mixed tabs and spaces, ragged indentation, inconsistent spacing around field numbers — and there is no widely-adopted off-the-shelf JavaScript proto pretty-printer to fix it. This proto formatter does exactly that: it re-indents block bodies by nesting depth, normalizes the spacing around `=` and `;`, and leaves your comments and string literals untouched.
It runs entirely in your browser. Your schema is never uploaded, logged, or sent to a server, which matters when your `.proto` files describe internal or proprietary APIs. Paste a file, get back tidy, consistent output, and copy it straight back into your repo.
Features
- Consistent indentation for message, enum, service, and oneof blocks
- Normalized spacing around "=" and ";" and inside field options
- Comments and string literals preserved exactly — braces inside them are ignored
- Idempotent: re-formatting already-clean output changes nothing
- Fully offline — your schema never leaves the browser
How to use
- Paste your .proto file into the input pane.
- Click Format to re-indent and normalize the whole schema.
- Toggle 4-space indent if you prefer wider indentation.
- Copy the formatted result back into your project.
Frequently asked questions
Does this validate my .proto schema?
No. This is a formatter, not a compiler. It tidies whitespace, indentation, and brace style by tracking brace depth, but it does not check that your types, field numbers, or imports are valid. Use protoc for full validation.
Will it reorder my fields or change field numbers?
No. The formatter never moves fields, renumbers them, or rewrites tokens. It only adjusts indentation and spacing, so the meaning of your schema is unchanged.
Are my comments preserved?
Yes. Both line comments (//) and block comments (/* */) are kept verbatim, including their internal spacing. Braces that appear inside comments or string literals are correctly ignored when computing indentation.
Is it safe to use on private schemas?
Yes. All formatting happens locally in your browser. Nothing you paste is sent to a server, so it is safe for internal or proprietary .proto definitions.
What indent size does it use?
Two spaces per level by default, which matches the common protobuf style guide. You can switch to four-space indentation with the toggle in the toolbar.
Related tools
Everything runs locally in your browser — your input is never uploaded.