Windows, Mac and Linux Path Converter

Paste C:\Users\me\file.txt or /home/me/file.txt and get every equivalent form, ready to paste into bash, PowerShell, cmd, JSON or Python.

브라우저에서 실행됩니다. 파일은 기기 밖으로 나가지 않습니다. 확인하는 방법 보기

…

사용 방법

  1. 1
    Paste your paths

    Put one path per line in the box, in any style, with or without surrounding quotes.

  2. 2
    Check how it was read

    Under Every form, the first path shows whether it was read as a drive path, a UNC share, a POSIX path or a relative path.

  3. 3
    Choose the target

    Pick Windows, Mac and Linux, WSL, Git Bash, Cygwin, UNC, file URL or the Windows long-path form.

  4. 4
    Pick quoting

    Choose bash, PowerShell, cmd, JSON, Python or URL encoding, and whether to quote only paths that need it.

  5. 5
    Tune the rules

    Resolve dot segments, set the trailing separator, the drive letter case and the WSL distribution name.

  6. 6
    Copy the result

    Copy a single form with its own button or copy and download the converted list.

이 도구 소개

Developers who work across Windows, WSL, macOS and Linux spend a surprising amount of time rewriting paths by hand: turning backslashes into slashes, remembering that drive C is /mnt/c inside WSL but /c in Git Bash and /cygdrive/c in Cygwin, writing a network share as \\server\share on Windows and //server/share elsewhere, or escaping every backslash before a path can go into a JSON config. This converter reads a path in any of those styles and writes it in all of them at once. It recognises drive-letter paths with either slash, UNC network shares, the \\?\ long-path prefix and its \\?\UNC\ form, the \\wsl$\ and \\wsl.localhost\ shares that expose Linux files to Windows, WSL mount paths, Git Bash and MSYS2 drive paths, Cygwin paths, absolute and home-relative POSIX paths, relative paths and file:// URLs with percent-encoding. Dot segments can be resolved, so src\lib\..\app.ts becomes src/app.ts, and trailing separators can be kept, added or removed. The first path in the box is shown in every target style with its own copy button. The whole list can be converted to one chosen style in a single pass, with blank lines and # comments left untouched and lines that have no equivalent marked clearly instead of being guessed. The result can then be quoted for a shell or a data format: single quotes with the '\'' trick for bash and zsh, doubled single quotes for PowerShell, double quotes with %% for cmd batch files, a JSON string with escaped backslashes, a Python raw string, or percent-encoding for URLs.

WSL in both directions

Inside WSL, Windows drives are mounted under /mnt with a lowercase letter, so D:\data becomes /mnt/d/data. From Windows, the Linux file system of a distribution appears as \\wsl.localhost\Ubuntu (older builds use \\wsl$\Ubuntu). Set the distribution name if yours is Debian, kali-linux or another one. The wslpath command does the same conversion inside WSL, but only for one path at a time and only on a machine where WSL is installed.

Paths that have no equivalent

Some paths cannot be translated faithfully. A path starting with ~ means the home folder of whoever runs the command, so there is no fixed Windows form. A relative path stays relative in every style. The \\localhost\C$ form uses the administrative share, which needs administrator rights, so it is only offered as a UNC option.

Quoting rules in short

In bash and zsh nothing inside single quotes is special, so the only problem is a single quote itself, which is closed, escaped and reopened. PowerShell doubles it instead. In cmd, double quotes protect spaces and most symbols, but percent signs still expand in batch files and are doubled here. A leading ~/ is left outside the quotes so the shell still expands it.

Limits

This is text conversion only. It does not check whether a path exists, follow symbolic links, resolve mapped network drive letters, or know your user name. Case sensitivity is not changed: Windows ignores letter case in paths, while Linux does not.

풀이 예시

A list of seven lines (five paths, a comment and a blank line) is converted to the WSL style with bash quoting where needed. C:\Users\Ann\Documents\Project Files\report (final).docx becomes '/mnt/c/Users/Ann/Documents/Project Files/report (final).docx' because of the spaces and brackets. \\fileserver\team\shared\budget.xlsx becomes //fileserver/team/shared/budget.xlsx, /home/ann/code/app/../app/src is tidied to /home/ann/code/app/src, file:///C:/Program%20Files/App/app.exe becomes '/mnt/c/Program Files/App/app.exe', and the comment line and blank line are kept, giving 5 converted lines.

한눈에 보기

자주 묻는 질문

Which way do slashes go on each system?

Windows uses the backslash \ as its separator but also accepts the forward slash / in most programs. macOS, Linux, WSL, Git Bash and URLs use only the forward slash. The converter accepts either on input and writes the native one for each target.

How do I open a WSL file in a Windows program?

Convert the Linux path with the WSL from Windows target. /home/ann/notes.md becomes \\wsl.localhost\Ubuntu\home\ann\notes.md, which File Explorer and Windows editors can open while the distribution is running.

What is the \\?\ prefix for?

It tells Windows APIs to skip path normalisation, which lifts the old 260-character limit. Because normalisation is skipped, the path must be absolute and must not contain . or .. segments, so the converter resolves those first.

Can I convert hundreds of paths at once?

Yes. Paste one path per line. Every line is converted with the same target style and quoting, the result can be copied or downloaded as a text file, and a counter shows how many lines had no equivalent.

Why does /c/Users become C:\Users?

Git Bash and MSYS2 write drive C as /c. If you work on Linux and really have a folder named /c, turn off Read /c/... as a Git Bash drive and it will be treated as an ordinary Linux folder.

Is anything sent to a server?

No. The paths you paste are converted by code running in your browser and are kept only in this browser's local draft.

완전 무료요금 없음, 가입 없음
파일은 비공개로 유지됩니다모든 작업이 브라우저 안에서 이루어집니다
내 언어로 쉽게여러 언어로 제공