# PATH Inspector

Paste the PATH environment variable to list it in search order (items higher up are searched first) and flag duplicates, empty items, relative paths and unexpanded variables. You can also build a PATH with duplicates removed, keeping the first occurrence. The ; separator of Windows and the : separator of Unix are detected automatically. It does not check that directories exist or contain programs; it inspects the text only. To inspect the contents of a .env file, use .env Studio.

- URL: https://tools.itlibra.com/en/path-inspector
- On-device・No upload
- Last updated: 2026-11-13

## How to use

1. Paste the output of echo %PATH%, PowerShell’s $env:Path or echo $PATH (one item per line also works). The samples show how it works.
2. In “List”, check the items in search order together with duplicates, empty items and relative paths.
3. In “Findings”, check the points specific to Windows and Unix: empty items, the current directory, quotes, surrounding whitespace and length.
4. In “Clean up”, copy or save the PATH without duplicates. Sorting can change which program runs, so it is off by default.

## Use cases

- Check whether the same directory is in PATH more than once
- See which directory is searched first when several programs share a name
- Check a Unix PATH for empty items (::) or .
- See how a Windows PATH looks with duplicates removed

## What it does

### List with search order

Items higher up are searched first. A duplicate shows which item it repeats, making it clear that the later one is never reached.

### Comparison rules per OS

On Windows, case, / versus \\ and a trailing \\ are ignored. On Unix, case matters and only a trailing / and repeated / are ignored.

### Empty items and the current directory

On Unix an empty item means the current directory (POSIX). Empty items and . are highlighted, and relative paths are flagged.

### Variables expanded only when you supply them

%VAR%, $VAR and \~ are expanded only with the values you enter under “Variable values”. The tool never reads your environment variables or the registry.

### Output without duplicates

Keeps the first occurrence and joins with the original separator. You can also drop empty items or sort (with a warning).


## Capability matrix

| Feature | Support | Notes |
| --- | --- | --- |
| Auto-detecting or choosing Windows (;) and Unix (:) | Supported | — |
| Findings for duplicates, empty items, the current directory, relative paths, quotes and surrounding whitespace | Supported | — |
| Output of a PATH without duplicates (copy and save) | Supported | — |
| Expanding variables you provide | Partial | Only those entered under “Variable values”, expanded once; no nested expansion |
| Windows length findings | Partial | Only the 32,767-character maximum of an environment variable and 260 characters (MAX\_PATH) per item; other limits are not covered |
| Checking that directories exist or hold executables | Not supported | A browser cannot inspect files on your machine |
| Reading the registry or current environment variables, or changing PATH | Not supported | — |

## Limits & notes

- Input is limited to 200,000 characters and 5,000 items. Anything beyond is not read.
- A separator (; on Windows) inside a quoted item still splits the item.
- Duplicates are judged by the text as written, without resolving symbolic links or ... Different spellings of the same location are not detected.
- Windows case-insensitive comparison covers ordinary characters.

## Privacy & safety

Pasted text is processed only inside your browser. Nothing is sent to or stored on a server, and nothing is saved in the browser. Usage analytics never include content.

## FAQ

### In what order is PATH searched?

From the leftmost (first) item onward; if several programs share a name, the first one found is used. So a duplicate item later in the list is never reached.

### Is it safe to remove duplicates from PATH?

If you keep the first occurrence, the search order stays the same, and this tool’s output does exactly that. Check the result before applying it to your real PATH.

### What does an empty item (::) in a Unix PATH mean?

It refers to the current directory (POSIX describes an empty item as a legacy feature). Remove it unless you intend that.

### Should PATH contain . ?

It is generally avoided, because a program with the same name in the directory you are working in may run.

### Is there a length limit for PATH on Windows?

An environment variable value can be at most 32,767 characters (per Microsoft’s documentation on environment variables). Settings dialogs or other methods may apply a shorter limit.

### How are \~ and $HOME handled?

Enter HOME and other values under “Variable values” to expand them for the comparison. Without them they are flagged as unexpanded.
