Gherkin Formatter
Format Gherkin feature files and align example tables.
This tool needs JavaScript enabled to run in your browser.
What this tool does
This tool reformats Gherkin feature files with consistent indentation, aligns example tables into neat columns, and flags basic structural problems such as a step that appears before any scenario.
How it indents
Feature and Rule sit at the left margin, Background and Scenario are indented one level, and steps a further level. Example tables are padded so the columns line up, which makes an outline far easier to read. Tags and comments are moved to the level of the block they belong to.
Common use cases
- Tidying a feature file before committing it.
- Aligning a scenario outline's examples table.
- Catching a misplaced step or a missing Feature line.
Frequently asked questions
- Does it validate my Gherkin?
- It checks basic structure, such as a step before any scenario or a missing Feature line, and reports warnings. It is not a full Cucumber parser.
- Does it align tables?
- Yes. Example and data tables are padded so the columns line up.
Learning resources
Testsmith also runs hands-on courses and a free practice app for the skills behind this tool.