Gherkin syntax checker and formatter

Paste a .feature file and the checker lists syntax mistakes by line, such as missing colons, steps out of order, empty scenarios and Examples tables that do not match their placeholders. It also returns a cleanly indented copy with aligned tables.

Everything runs in your browser. Your text and files stay on your device and are never uploaded.

Problems

Paste or type a feature file above and the checks run as you type.

Formatted feature file

How to use it

  1. Paste your feature file into the box, or open a .feature file from your computer.
  2. Read the problems list. Errors break parsers, warnings are style and structure advice, and each one names its line.
  3. Fix the lines in your text. The list updates as you type.
  4. Check the formatted file below: two-space indentation, aligned tables and a blank line between scenarios.
  5. Copy the result or download it as a .feature file, or replace your text with it.

Gherkin keywords at a glance

KeywordUse
Feature:One per file. Names the behavior and may carry a short description.
Background:Given steps that run before every scenario in the file.
Scenario:One concrete example. Also written Example:.
Scenario Outline:A template with <placeholders> filled from an Examples table.
Given / When / ThenSetup, action, outcome. And, But and * continue the previous one.
Rule:Groups scenarios under one business rule (Gherkin 6 and later).

Questions

What does a Gherkin syntax checker look for?

It checks that each line is a keyword, step, tag, comment, table or doc string, that keywords end in a colon, and that structure holds: one Feature, one Background per Feature or Rule, scenarios with steps, no steps after Examples, placeholders that match their Examples columns, and tables with equal row widths.

Why is a lowercase given or when an error?

Gherkin keywords are case sensitive in Cucumber and most other runners. A line starting with given is read as plain text, so the step is silently lost or the parse fails.

What is the difference between Scenario and Scenario Outline?

A Scenario is one fixed example. A Scenario Outline is a template with <placeholders> that runs once per row of its Examples table, so every placeholder must match a column header.

Should a scenario have more than one When?

Usually not. A scenario with a single When tests one action, so a failure points at one cause. The checker warns on a second When and leaves the decision to you.

Does it run my steps or match them to code?

No. It checks syntax and structure only. Whether a step has a matching step definition is decided by your Cucumber, Behave, SpecFlow or similar runner.

Does it support languages other than English?

Not yet. Files with a # language header other than en are left untouched, because the keywords in other languages would show false errors.

More free tools

All free tools