Developer

Glob Tester

Test glob patterns against newline file/path candidates.

Loading interactive tool…

Embed this tool on your site

About this tool

Glob patterns are the universal language for matching file paths — from .gitignore rules to tsconfig include arrays, Docker COPY instructions, shell scripts, and CI pipeline path filters. It is easy to write a pattern that matches more or less than intended without a way to test it. Glob Tester lets you enter a pattern, paste a list of file paths one per line, click Test, and see which lines match. It supports a basic subset of glob syntax: * for any characters within a single path segment, ? for exactly one character other than /, and ** as a whole segment for any number of directories. Each candidate is matched as a whole line. Character classes such as [abc], brace expansion such as {ts,tsx}, and negation are not supported — those characters are matched literally. Matching runs in your browser and you can copy the list of matching paths.

Why use it

  • Quick Match Check: Click Test and the whole candidate list is evaluated at once, with only the matching paths listed so you can see exactly what the pattern selects.

  • Supports ** Deep Wildcards: Handles the ** multi-segment wildcard used in .gitignore, tsconfig, Bash globstar, and build tools, including zero directories, so **/*.ts matches app.ts as well as src/a/b.ts.

  • Segment-Aware * and ?: A single * or ? never crosses a / separator, matching how most glob tools treat path segments.

  • No Shell or Node.js Required: Test glob patterns directly in the browser — no need to create test files, run a shell script, or install a glob library just to validate a pattern.

  • Whole-Line Matching: Each candidate must match the pattern from start to end, so src/*.ts will not accidentally match src/app.ts.bak or lib/src/app.ts.

  • Copyable Results: Copy the list of matching paths with one click to paste into a ticket, code review, or script.

How to use

  1. Enter your glob pattern in the Pattern field — for example *.ts, src/**/*.js, or **/__tests__/**.
  2. Paste your list of file paths into the Candidates box, one path per line — use relative paths without a leading slash.
  3. Click Test to evaluate the pattern against every line.
  4. Read the Matches box, which lists only the matching paths, or '(no matches)' if none match.
  5. Adjust the pattern and click Test again to see which paths enter or leave the match set.
  6. Click Copy to copy the matching paths, then put the tested pattern into your configuration file once you are satisfied.

When it helps

  • When writing a .gitignore rule and you want to verify it ignores exactly the intended files without accidentally excluding tracked source files.
  • When configuring the include or exclude arrays in tsconfig.json and you need to confirm the TypeScript compiler will see the right set of .ts files.
  • When writing a webpack entry glob and you want to see exactly which modules will be bundled before running the build.
  • When authoring a GitHub Actions workflow with path filters (on.push.paths) and you want to verify which file changes will trigger the workflow.
  • When writing a shell glob in a Makefile or CI script and you need to confirm the pattern expands to the correct set of files without running it on the live filesystem.
  • When debugging a recursive pattern like **/*.test.ts to see exactly which test files a test runner will pick up from a specific directory tree.

Examples

Match TypeScript source files only

Input
Pattern: src/**/*.ts
Candidates:
src/app.ts
src/components/Button.ts
src/utils/helpers.ts
src/styles/main.css
dist/app.js
README.md
Expected result
src/app.ts
src/components/Button.ts
src/utils/helpers.ts

Find files inside test folders

Input
Pattern: **/__tests__/**
Candidates:
src/__tests__/app.test.ts
src/__tests__/utils.test.ts
src/app.ts
src/utils/helpers.ts
Expected result
src/__tests__/app.test.ts
src/__tests__/utils.test.ts

Single-char wildcard for numbered files

Input
Pattern: log-?.txt
Candidates:
log-1.txt
log-2.txt
log-10.txt
error.txt
Expected result
log-1.txt
log-2.txt

Tips

  • Test the inverse of your intended pattern too — paste a set of paths you do NOT want to match and check that none of them appear in the Matches box, preventing accidental over-matching.
  • When debugging a tsconfig.json include that is missing files, start with ** and progressively narrow to **/*.ts, then src/**/*.ts, to isolate which segment of the pattern is rejecting the files you expect.
  • For .gitignore testing, remember that .gitignore interprets a pattern without any / as matching at any directory depth — in this tool, write **/ in front to see the same effect.
  • Brace expansion like **/*.{ts,tsx} is not supported here; test each extension as its own pattern, then combine them in your config if your target tool supports braces.
  • Include a few paths that should NOT match alongside the ones that should when building your test list — this guards against accidentally writing an overly broad pattern like ** that matches everything.

Frequently Asked Questions

What is the difference between * and ** in glob patterns?
A single * matches any sequence of characters within a single path segment — it will not cross a / separator. So src/*.ts matches src/app.ts but not src/components/Button.ts. A double ** matches across path separators and any number of directory levels, so src/**/*.ts matches both src/app.ts and src/components/Button.ts.
Does the tool match .gitignore semantics exactly?
No. It implements a basic glob subset: * and ? within one path segment, and ** as a whole segment for any depth. .gitignore adds rules such as matching a slash-free pattern at any depth and negating with a leading !, which this tool does not apply. Verify .gitignore behavior with 'git check-ignore -v' on the actual repository.
What does ? match?
A ? matches exactly one character at that position in the path segment. It does not match / separators. So file?.js matches file1.js and fileA.js but not file10.js and not dir/file1.js.
Are character classes like [abc] supported?
No. Square brackets are treated as literal characters, so src/[abc]*.ts only matches a path that literally contains [abc]. If you need character classes, test them in your target tool (for example a quick script using minimatch) — this tester covers *, ? and ** only.
Should I include a leading slash in my file paths?
Use relative paths without a leading slash (e.g. src/app.ts, not /src/app.ts) for most use cases. .gitignore, tsconfig, and webpack all operate on relative paths from the project root. Leading slashes anchor the match differently across implementations — omitting them gives the most predictable results in this tool.
Why does my ** pattern not match the root-level files?
** matches zero or more path segments, so **/*.ts should match both root-level .ts files and deeply nested ones. If root files are not matching, check that the pattern does not have an unintended leading directory component. A pattern like src/**/*.ts will only match files inside the src directory, not at the project root.
Can I test multiple glob patterns or brace expansion at once?
The tool evaluates a single pattern against the whole candidate list. Brace expansion such as **/*.{ts,tsx} is not supported — braces are matched literally — so test **/*.ts and **/*.tsx separately and combine the results.
Is the glob implementation the same as Node.js minimatch or Bash globstar?
No. The tool converts the pattern to a simple regular expression and matches each whole line against it. Unlike minimatch's defaults, * also matches names that start with a dot (so *.js matches .eslintrc.js), and character classes, braces and extglobs are not supported. Use it for quick checks of *, ? and ** patterns.

Explore the category

Glossary

Glob
A pattern language for matching file paths using wildcard characters. The word 'glob' comes from the Unix shell's 'global' command for expanding filename patterns.
** (double star)
A glob wildcard that matches any number of path segments including zero, crossing directory boundaries. **/*.ts matches TypeScript files at any depth in the directory tree.
* (single star)
A glob wildcard that matches any sequence of characters within a single path segment, not crossing / separators. *.js matches any .js file in the current directory only.
? (question mark)
A glob wildcard that matches exactly one character at that position in a path segment, excluding / separators. Useful for matching files with single-character variation.
minimatch
A popular Node.js library implementing glob matching, used internally by webpack, Jest, TypeScript, and ESLint. The de-facto standard for glob semantics in the JavaScript ecosystem.
Dotfile
A file or folder whose name starts with a dot, such as .eslintrc.js. Many glob libraries skip dotfiles for * by default; this tester's * matches them like any other name.
A LITTLE HELP. A LOT DONE.
Good tools.
Great flow.

Your shortcut to the everyday. Create, convert, calculate,
and get back to what you love.

✓ Free to use✓ No sign-up✓ 500+ possibilities