Shell Brace Expansion Expander

Bash brace expansion is one of the most useful shell features and one of the easiest to get wrong. file.{txt,md} expands to two filenames; img-{01..10}.png generates 10 zero-padded filenames; {a,b}{1,2} generates the cartesian product. This tool expands any brace expression so you can verify it before running anything dangerous like rm or mv.

How to use the Shell Brace Expansion Expander

Type a brace expression. Supported syntax: comma lists {a,b,c}, numeric ranges {1..10} with optional zero-padding {01..10} and step {1..20..2}, letter ranges {a..f}, and nesting / chaining for cartesian products.

Previewing bash brace expansion safely

Brace expansion is one of bash’s most useful features and one of the easiest to misjudge. file.{txt,md} becomes two names, img-{01..10}.png generates ten zero-padded names, and {a,b}{1,2} produces a cartesian product. Get it wrong in front of rm or mv and you delete or move the wrong files.

This expands any brace expression so you can see the full list before running a command. It supports comma lists, numeric ranges with optional zero-padding and a step, letter ranges, and nesting for cartesian products. The expanded output is plain lines you can then order or clean with sort lines and deduplicate lines.

Common use cases

  • Verifying before rm/mv — expand a pattern to see exactly which names it produces.
  • Generating filenames — produce a numbered or zero-padded sequence of names.
  • Building URL lists — expand {a,b,c} segments into full URLs.
  • Cartesian products — combine environments and regions into every pairing.
  • Learning the syntax — see how ranges, steps, and nesting expand.

Frequently asked questions

What syntax is supported?

Comma lists {a,b,c}, numeric ranges {1..10} with optional zero-padding {01..10} and step {1..20..2}, letter ranges {a..f}, and nesting for cartesian products.

Why preview an expansion?

To confirm a command will touch exactly the files you intend before running something destructive like rm or mv.

Does {01..10} keep the leading zeros?

Yes. A zero-padded range preserves the padding width across the whole sequence.

Can I combine multiple braces?

Yes. Adjacent braces multiply out into a cartesian product — {a,b}{1,2} yields four results.
Embed this tool on your site

Free to embed, no attribution required (but appreciated). Paste this where you want the tool to appear: