A free, open-source LaTeX editor that runs entirely in your browser.
No accounts. No installs. No servers. Just open a tab and write.
Try it now → tex.swimmingbrain.dev
I built this because I was tired of paying for features that should be free. I wrote my thesis last year in LaTeX and spent more time fighting tooling than actually writing. Online solutions lock git sync behind a paywall. Local setups break between machines. I wanted something that just works. Open a browser, write LaTeX, get a PDF.
So I built it.
texbrain is a full LaTeX editor that compiles your .tex files to PDF directly in the browser. There is no backend. No server processing your files. Everything (the editor, the compiler, the git client) runs client-side.
You can open a local project folder, edit your files, see the PDF update, commit your changes, and push to GitHub. All from one tab.
.tex files are compiled to PDF without ever leaving your machine. Packages are loaded on demand and cached locally, so the first compile only downloads what your document actually uses. Recompilations take 1 to 5 seconds depending on project complexity.memoir, abntex2, KOMA-Script, you name it) is resolved automatically from a TeX Live mirror the first time a document needs it, then cached locally for offline use..tex, .bib, .sty, .cls and more.There's no magic and no backend.
Editor. Built on CodeMirror 6 with a custom LaTeX grammar (Lezer parser), autocomplete provider, and theme system. The editor supports multiple open files via tabs and writes straight to the files on disk, which is also where git looks.
Compiler. LaTeX compilation uses SwiftLaTeX's pdfTeX engine compiled to WebAssembly. The engine runs in a memory filesystem (MEMFS), where your project files are written before each compilation. When the engine asks for a file it doesn't have (a class, package, font, ...), the service worker resolves it through a chain: previously cached files first, then the package subset bundled with the app, then a TeX Live mirror (a texmf-dist mirror on jsDelivr, with a community SwiftLaTeX server as fallback). Every resolved file is stored in the browser's cache storage, so each package is downloaded at most once. After the first successful compile, the bundled subset is also prefetched in the background so the core package set works offline.
Git. All git operations use isomorphic-git, a pure JavaScript implementation of git. It runs straight on your project folder through a small adapter around the File System Access API, so the .git directory lives next to your .tex files like it would with a terminal, and a folder that already is a repository is picked up as is. Remote operations (push/pull/clone) go through a CORS proxy since browsers can't speak the git protocol directly.
PDF viewer. Rendered with pdf.js, Mozilla's PDF rendering library. Supports multi-page rendering with a text layer for selection and search.
File system. The app uses the File System Access API to read/write your actual files on disk. This requires a Chromium-based browser (Chrome, Edge, Arc, Brave). For other browsers, there's a fallback using the Origin Private File System (OPFS).
Frontend. SvelteKit with the static adapter. The entire app is pre-built to static HTML/CSS/JS and deployed to GitHub Pages. No SSR, no API routes, no server. Tailwind CSS handles styling.
LaTeX errors are famous for being unreadable, so TeXbrain does the reading for you. The Problems tab turns the log into cards: a headline in plain words ("Unknown command \foo", "Math outside math mode", "Package doesnotexist not found"), what it means, what to try, the file and line, and the source line exactly as TeX read it with a bar where it stopped. Click a card and the editor jumps there, opening the file if it has to. Errors that TeX can't place, a missing package for example, are placed by searching your sources for them.
Warnings get the same treatment (undefined labels, citations, hyperref bookmarks). Notes about margins and stretched lines are there too, hidden until you switch them on. Every card can be copied as text, "Copy all" gives you a report to paste anywhere, and problems that look like TeXbrain's fault rather than your document's have a link that opens a prefilled issue.
The Log tab still has everything the engine printed, with colors, line numbers, search, a full/clean toggle, copy and download.
Git in TeXbrain works on the folder you opened, the same way a terminal would. A hidden .git directory sits next to your .tex files, so you can switch between TeXbrain, the command line and any other editor without anything getting out of sync. Folders that already are repositories are picked up as they are, history included.
.gitignore for the files LaTeX leaves behind while compiling.A few things to know:
cors.isomorphic-git.org, run by the isomorphic-git project, and your token passes through it. You can point TeXbrain at your own proxy in the git settings, it is a tiny node app.fontspec, polyglossia, the TikZ graphdrawing library and anything else that needs them won't compile.biblatex get a plain thebibliography generated from the .bib file, so references show up but the citation style is ignored. Classic bibtex workflows need a .bbl in the project. A real bibtex in WASM is next on the list.Everything runs in your browser. Your files never leave your machine unless you explicitly push to a remote.
pdflatex, no exec(), no spawn().cors.isomorphic-git.org (the isomorphic-git project's public proxy). You can point it at your own if you prefer.texliveMirror preference (empty string turns it off).| Layer | Technology |
|---|---|
| Framework | Svelte 5 + SvelteKit (static adapter) |
| Editor | CodeMirror 6 + custom LaTeX language support |
| Compiler | pdfTeX via WebAssembly (SwiftLaTeX) |
| Git | isomorphic-git + LightningFS |
| pdf.js | |
| Styling | Tailwind CSS 4 |
| Language | TypeScript |
| Deployment | GitHub Pages |
git clone https://github.com/swimmingbrain/texbrain.git
cd texbrain
pnpm install
pnpm dev
Open http://localhost:5173 in Chrome or Edge.
Full functionality requires the File System Access API, which is available in Chromium-based browsers (Chrome, Edge, Arc, Brave, Opera). Firefox and Safari can still use the editor with the virtual filesystem fallback, but won't be able to read/write directly to local folders.
There is no formal process. Fork, change, open a pull request. docs/CONTRIBUTING.md has the layout of the code and what kind of help matters most right now.
MIT
Built by Braian Plaku
169 commits
1 commits
Svelte
52.0%
TypeScript
40.8%
JavaScript
3.0%
CSS
2.0%
TeX
1.8%
A free, open-source LaTeX editor that runs entirely in your browser.
No accounts. No installs. No servers. Just open a tab and write.
Try it now → tex.swimmingbrain.dev
I built this because I was tired of paying for features that should be free. I wrote my thesis last year in LaTeX and spent more time fighting tooling than actually writing. Online solutions lock git sync behind a paywall. Local setups break between machines. I wanted something that just works. Open a browser, write LaTeX, get a PDF.
So I built it.
texbrain is a full LaTeX editor that compiles your .tex files to PDF directly in the browser. There is no backend. No server processing your files. Everything (the editor, the compiler, the git client) runs client-side.
You can open a local project folder, edit your files, see the PDF update, commit your changes, and push to GitHub. All from one tab.
.tex files are compiled to PDF without ever leaving your machine. Packages are loaded on demand and cached locally, so the first compile only downloads what your document actually uses. Recompilations take 1 to 5 seconds depending on project complexity.memoir, abntex2, KOMA-Script, you name it) is resolved automatically from a TeX Live mirror the first time a document needs it, then cached locally for offline use..tex, .bib, .sty, .cls and more.There's no magic and no backend.
Editor. Built on CodeMirror 6 with a custom LaTeX grammar (Lezer parser), autocomplete provider, and theme system. The editor supports multiple open files via tabs and writes straight to the files on disk, which is also where git looks.
Compiler. LaTeX compilation uses SwiftLaTeX's pdfTeX engine compiled to WebAssembly. The engine runs in a memory filesystem (MEMFS), where your project files are written before each compilation. When the engine asks for a file it doesn't have (a class, package, font, ...), the service worker resolves it through a chain: previously cached files first, then the package subset bundled with the app, then a TeX Live mirror (a texmf-dist mirror on jsDelivr, with a community SwiftLaTeX server as fallback). Every resolved file is stored in the browser's cache storage, so each package is downloaded at most once. After the first successful compile, the bundled subset is also prefetched in the background so the core package set works offline.
Git. All git operations use isomorphic-git, a pure JavaScript implementation of git. It runs straight on your project folder through a small adapter around the File System Access API, so the .git directory lives next to your .tex files like it would with a terminal, and a folder that already is a repository is picked up as is. Remote operations (push/pull/clone) go through a CORS proxy since browsers can't speak the git protocol directly.
PDF viewer. Rendered with pdf.js, Mozilla's PDF rendering library. Supports multi-page rendering with a text layer for selection and search.
File system. The app uses the File System Access API to read/write your actual files on disk. This requires a Chromium-based browser (Chrome, Edge, Arc, Brave). For other browsers, there's a fallback using the Origin Private File System (OPFS).
Frontend. SvelteKit with the static adapter. The entire app is pre-built to static HTML/CSS/JS and deployed to GitHub Pages. No SSR, no API routes, no server. Tailwind CSS handles styling.
LaTeX errors are famous for being unreadable, so TeXbrain does the reading for you. The Problems tab turns the log into cards: a headline in plain words ("Unknown command \foo", "Math outside math mode", "Package doesnotexist not found"), what it means, what to try, the file and line, and the source line exactly as TeX read it with a bar where it stopped. Click a card and the editor jumps there, opening the file if it has to. Errors that TeX can't place, a missing package for example, are placed by searching your sources for them.
Warnings get the same treatment (undefined labels, citations, hyperref bookmarks). Notes about margins and stretched lines are there too, hidden until you switch them on. Every card can be copied as text, "Copy all" gives you a report to paste anywhere, and problems that look like TeXbrain's fault rather than your document's have a link that opens a prefilled issue.
The Log tab still has everything the engine printed, with colors, line numbers, search, a full/clean toggle, copy and download.
Git in TeXbrain works on the folder you opened, the same way a terminal would. A hidden .git directory sits next to your .tex files, so you can switch between TeXbrain, the command line and any other editor without anything getting out of sync. Folders that already are repositories are picked up as they are, history included.
.gitignore for the files LaTeX leaves behind while compiling.A few things to know:
cors.isomorphic-git.org, run by the isomorphic-git project, and your token passes through it. You can point TeXbrain at your own proxy in the git settings, it is a tiny node app.fontspec, polyglossia, the TikZ graphdrawing library and anything else that needs them won't compile.biblatex get a plain thebibliography generated from the .bib file, so references show up but the citation style is ignored. Classic bibtex workflows need a .bbl in the project. A real bibtex in WASM is next on the list.Everything runs in your browser. Your files never leave your machine unless you explicitly push to a remote.
pdflatex, no exec(), no spawn().cors.isomorphic-git.org (the isomorphic-git project's public proxy). You can point it at your own if you prefer.texliveMirror preference (empty string turns it off).| Layer | Technology |
|---|---|
| Framework | Svelte 5 + SvelteKit (static adapter) |
| Editor | CodeMirror 6 + custom LaTeX language support |
| Compiler | pdfTeX via WebAssembly (SwiftLaTeX) |
| Git | isomorphic-git + LightningFS |
| pdf.js | |
| Styling | Tailwind CSS 4 |
| Language | TypeScript |
| Deployment | GitHub Pages |
git clone https://github.com/swimmingbrain/texbrain.git
cd texbrain
pnpm install
pnpm dev
Open http://localhost:5173 in Chrome or Edge.
Full functionality requires the File System Access API, which is available in Chromium-based browsers (Chrome, Edge, Arc, Brave, Opera). Firefox and Safari can still use the editor with the virtual filesystem fallback, but won't be able to read/write directly to local folders.
There is no formal process. Fork, change, open a pull request. docs/CONTRIBUTING.md has the layout of the code and what kind of help matters most right now.
MIT
Built by Braian Plaku
169 commits
1 commits
Svelte
52.0%
TypeScript
40.8%
JavaScript
3.0%
CSS
2.0%
TeX
1.8%