Tools change the selected lines, or the whole file when nothing is selected. Every change can be undone.
About this tool
A free online code editor that opens instantly in your browser, with no sign-up or install. Write and edit code in more than 60 languages, including JavaScript, TypeScript, Python, Java, C, C++, C#, Go, Rust, PHP, SQL, HTML, CSS, JSON, YAML, Kotlin, Swift, Ruby and Bash. Work on several files in tabs with syntax highlighting, autocomplete, bracket matching, code folding, multiple cursors, find and replace and one-click formatting. The editor is for editing only and never runs your code. Files stay on your device: they are autosaved in this browser and are never uploaded.
Features
60+ languages
Syntax highlighting for web, general-purpose, scripting, data and functional languages, from JavaScript and Python to Kotlin, Haskell, Dockerfile, Nginx and LaTeX. Languages load on demand, so the page stays fast.
Multiple files in tabs
Open up to 20 files at once. Rename a tab by double-clicking it, close one with the × or a middle-click, and undo an accidental close. Each tab keeps its own undo history and cursor.
Smart language detection
The language follows the file extension, including names such as Dockerfile and .env. Paste into an empty untitled file and the editor recognizes Python, Java, SQL, JSON and more.
Autocomplete and auto-close
Suggestions for keywords, HTML tags, CSS properties, SQL keywords and words already in the file, plus automatic closing of brackets, quotes and HTML tags.
Format with Prettier
Format JavaScript, TypeScript, JSX, CSS, SCSS, Less, HTML, Vue, JSON, Markdown and YAML using your indentation settings. Other languages are re-indented by their own indentation rules.
Syntax error highlighting
Languages with a full grammar, such as JavaScript, TypeScript, Python, Java, C++, Go, Rust, PHP, JSON and YAML, get wavy underlines on syntax errors and a problem count in the status bar.
Find, replace and multiple cursors
Search with regular expressions, case and whole-word options, replace one or all matches, select every occurrence, add cursors with Ctrl/⌘ + click, or drag a box selection with Alt.
Code folding and navigation
Fold functions, blocks and tags from the gutter, fold or unfold everything at once, jump to any line, and match brackets as you move the cursor.
Edit tools
Sort, reverse, de-duplicate, shuffle or join lines, remove blank lines and trailing spaces, change case to camelCase, snake_case or kebab-case, convert tabs and spaces, and toggle comments.
Comfortable settings
Choose spaces or tabs, tab size, font size, word wrap, a column ruler at 80, 100 or 120 characters, visible whitespace and light or dark theme. Settings are remembered.
Download, ZIP and share
Save the current file with its name and extension or every tab as a ZIP, keep LF or CRLF line endings, and share all files or one file by link, share sheet or QR code. Opening a shared link adds tabs without replacing anyone's own files.
Private and autosaved
Code never leaves your browser and is never executed. Open files are autosaved locally so they are still there after a reload; turn that off with one switch.
How to edit code online without installing anything
Open the page and start typing: the editor loads with a small HTML, CSS and JavaScript project so you can see tabs and highlighting at work. Select New for an empty file, or choose a language from the menu first. Changing the language also updates the file extension, so untitled.js becomes untitled.py.
To work on files from your computer, select Open (you can choose several at once) or drag them onto the editor. Each file opens in its own tab with its language detected from the name, and the editor adopts the file's indentation. When you are done, press Ctrl/⌘ + S to download the file you are on, or ZIP to download every tab together.
- Your files are autosaved in this browser after every change, so a reload or closed tab does not lose work.
- Turn off Remember files in Settings on a shared computer, then close the tab to clear them.
- Line endings stay as they were: Windows files keep CRLF when downloaded. Switch between LF and CRLF in the status bar.
Format and clean up code
Format uses Prettier, the formatter most JavaScript and web projects already use, for JavaScript, TypeScript, JSX, TSX, CSS, SCSS, Less, HTML, Vue, JSON, Markdown and YAML. It respects your choice of spaces or tabs and tab size, and wraps lines at the column ruler (80 characters when the ruler is off). If the code has a syntax error, the message names the line and column and Show in editor jumps straight to it.
For languages without a Prettier formatter, such as Python, Java, Go or SQL, the button becomes Re-indent and fixes the leading whitespace of each line using the language's indentation rules. It does not reorder or rewrap code. Every formatting change is one undo step.
const total=items.filter(i=>i.qty>0).reduce((sum,i)=>sum+i.price*i.qty,0)
const total = items
.filter((i) => i.qty > 0)
.reduce((sum, i) => sum + i.price * i.qty, 0);Keyboard shortcuts that save time
The editor follows the shortcuts of desktop editors such as VS Code, so muscle memory carries over. The Keyboard shortcuts tab under the editor lists them all, shown with ⌘ and ⌥ on a Mac.
- Ctrl/⌘ + F: find and replace, with regular expressions and whole-word matching.
- Ctrl/⌘ + D: select the next occurrence of the current word to edit several at once.
- Ctrl/⌘ + /: comment or uncomment the selected lines in the current language.
- Alt + ↑ / ↓: move lines; Shift + Alt + ↑ / ↓: duplicate them.
- Ctrl/⌘ + Alt + G: go to a line number. Shift + Alt + F: format.
- Press Esc then Tab to move keyboard focus out of the editor, since Tab indents inside it.
Supported languages
Highlighting, folding and comment toggling cover these languages. Those marked with a full grammar also get syntax error checking and smarter indentation; the rest use lighter highlighting modes that load in a fraction of a second.
- Web: HTML, CSS, SCSS, Sass, Less, JavaScript, JSX, TypeScript, TSX, Vue, PHP, Markdown.
- General purpose: Python, Java, Kotlin, C#, C, C++, Go, Rust, Swift, Dart, Scala, Groovy, Objective-C, Visual Basic.
- Scripting and shell: Bash, PowerShell, Ruby, Perl, Lua, R, Julia, MATLAB/Octave.
- Data and config: JSON, YAML, TOML, XML/SVG, SQL, PostgreSQL, MySQL, INI/.env, Dockerfile, Nginx, Protocol Buffers, CMake, Diff.
- Functional and other: Haskell, Elm, F#, OCaml, Clojure, Scheme, Common Lisp, Erlang, LaTeX, Pascal, Fortran, Verilog, VHDL, Assembly, Gherkin, plain text.
How to use it
- Pick a language from the menu, open files from your device, drop them onto the editor, or paste code. The language is detected from the file name or the pasted code.
- Edit with autocomplete, auto-closing brackets, multiple cursors and find and replace. Use Format (Shift + Alt + F) to tidy code, and the Edit tools to sort lines or change case.
- Download the current file (Ctrl/⌘ + S) or every tab as a ZIP, copy the code as a Markdown block, or select Share to send a link or QR code that keeps the code inside the URL.
Common uses
- Edit a script, config file or snippet on a computer where you cannot install VS Code
- Tidy and review code before pasting it into a ticket, chat, email or Stack Overflow question
- Keep a few related files open together, such as HTML, CSS and JavaScript, and download them as a ZIP
Common questions
Can this online code editor run my code?
No. It is an editor only: it highlights, checks and formats code but never compiles or executes it, in your browser or on a server. That keeps it fast and safe for any language. Copy or download the code to run it in your own environment.
Is my code uploaded or stored on a server?
No. Editing, formatting and syntax checks all happen in your browser. Files are autosaved only in this browser's local storage, and share links carry the code inside the part of the URL after #, which browsers do not send to the server.
How do I change the programming language?
Use the language menu above the editor, or rename the file: a name ending in .py switches to Python, .java to Java, and so on. Opening a file or pasting into an empty untitled file detects the language automatically.
Which languages can be formatted?
JavaScript, JSX, TypeScript, TSX, CSS, SCSS, Less, HTML, Vue, JSON, Markdown and YAML are formatted with Prettier. Other languages get Re-indent, which fixes each line's indentation using the language's rules.
Can I work with more than one file?
Yes. Open up to 20 files in tabs, rename them by double-clicking, and download them one at a time or all together as a ZIP archive. Each tab keeps its own undo history.
Does it work on phones and tablets?
Yes. The toolbar and tabs adapt to small screens and the editor supports touch selection. Full screen mode gives the editor the whole display, which helps on a phone.
How large a file can I open?
Files up to 5 MB open in the editor. Workspaces up to about 2 million characters are autosaved; larger ones stay open until you close the tab, so download them before leaving.
How do I share code with someone?
Select Share next to Format, choose all open files or just the current one, then copy the link, send it with your device's share sheet, or show a QR code to open it on a phone. The code travels inside the link itself, so nothing is uploaded. When someone opens the link, the files are added as new tabs and their own files are kept.
Can’t find the tool you need?
Tell us what you’d like it to do. We’ll review your suggestion for a future tool.