Format an Nginx configuration

Paste a compact or poorly indented Nginx configuration block: the tool puts each directive on its own line and indents nested { } blocks (server, location, http...) for instant readability.

Example:

How it works

The tool scans the text character by character, spotting the opening and closing braces and the semicolons that end each Nginx directive, while ignoring these symbols when they appear inside a quoted string or after a # comment marker. Each directive gets its own line, indented by 4 spaces per { } block level. It is a formatter based on the file's syntactic structure, not a validator: it does not check that directives or their arguments are valid for Nginx.

Are comments preserved?

Yes, comments starting with # are kept as they are and are never interpreted as directive separators, even if they contain braces or semicolons.

Will the reformatted file still work?

Yes, only the presentation (line breaks, indentation) is changed: the directives, their arguments and the order of the blocks remain strictly identical to the original.

No data is sent to a server: formatting runs entirely in your browser, in local JavaScript.