piapia123
en

Bash Brace Expansion

Web

Everything runs locally in your browser — nothing is uploaded

Input
Drop a file here to load its contents
Output

Paste one or more brace patterns and get every expansion at once. It follows bash semantics: `{a}` and `{a,b}` differ — the first is not expanded (it stays `{a}`), while the second becomes `a b`; and `{1..1}` expands to a single item `1`. Ranges support a step (`{1..10..2}`), reverse order (`{10..1}`), zero padding (`{01..03}`) and letters (`{a..e}`), and lists nest freely (`{a,b}{1,2}`). An escaped `\{` and an unclosed `{` are treated as ordinary characters rather than errors. Expansion only builds strings — it does not check whether files exist, exactly like `echo` in bash — and it all runs locally in your browser, with nothing uploaded.

Features

  • Comma lists: `{a,b,c}` expands to three items, prefix and suffix kept
  • Numeric ranges with a step: `{1..10..2}` gives 1 3 5 7 9
  • Reverse order follows the endpoints: `{10..1}` needs no negative step
  • Zero padding: `{01..03}` gives 01 02 03, padded to the wider endpoint
  • Letter ranges: `{a..e}` and `{z..v}`, with steps and reverse order too
  • Nesting and cartesian products: `{a,{b,c}}`, `{a,b}{1,2}`
  • A single-element `{a}` is left as is; `{1..1}` expands to one item
  • Escaped `\{` and an unclosed `{` are kept as plain characters
  • A per-line maximum, so a runaway pattern errors instead of freezing the browser
  • One block per pattern, each item copyable on its own or all at once

How to use

  1. Paste one pattern per line, e.g. `file{1..3}.txt`
  2. Every item is listed at once, with the expansion count
  3. Lower the maximum expansions if a pattern is too large
  4. Use the row copy button for one item, or Copy all for the whole list

FAQ

Why is `{a}` not expanded to `a`?
That is bash semantics: a brace with neither a comma nor a valid range is kept literally, so `{a}` stays `{a}` and `file{a}.txt` stays `file{a}.txt`. If you want `filea.txt`, just write it. The one that does expand is the range `{1..1}`, which gives a single item `1` — the pair is easy to mix up.
Does `{1..03}` pad with zeros?
Yes. If either endpoint has a leading zero, every item is zero-padded to the width of the wider endpoint, so `{1..03}` gives `01 02 03`, not `1 2 03`. With no leading zero on either side (`{1..3}`) there is no padding.
Do the expanded file names actually exist?
They are not checked. Brace expansion only builds strings; it never touches the filesystem or the network. Just like `echo file{1..3}.txt` in bash, it prints three names even when none of the files exists.
Why is there a maximum expansion count?
Because `{1..1000000000}` would enumerate gigabytes of text and freeze the browser. The tool counts first (ranges are computed arithmetically, not enumerated) and errors once the limit is passed. The default is 1000 and can be raised.

Related tools