Flat / Source code hosting
Share source code online: highlighted files with a link
Give someone a reading link to your source code. Publish files from your browser or the CLI for syntax-highlighted viewing, copying, and original downloads. Uploaded scripts do not run on Flat.
Checking your upload limits... · Public · Limits
Drop your Source code files here
or choose them from your device.
Select Source code filesWhat readers see at your Source code link
Flat shows recognized source files in its text viewer, with syntax highlighting, line numbers, wrapping, and a copy action. The screenshot shows the actual viewer in Dark theme, with a TypeScript example selected beside its handoff notes.
Readers can select files in the explorer without cloning a repository. This is source reading: the viewer does not execute the selected code, install dependencies, or provide a terminal. Long files can have a shortened preview; the original download contains the complete source.
A single file opens in the viewer. Several files open in the explorer, where readers can choose a file. Public links need no Flat account. Original downloads remain available if a preview cannot load.
The main link opens Flat's viewer. The exact path /summary.ts serves the original file, without changing its contents.
How to upload Source code files and get a link
Prepare your file
Save UTF-8 source with its usual extension, such as
.ts,.py, or.php. Use descriptive filenames and include notes about the runtime, dependencies, and steps a recipient needs to run the example in their own environment.For several files, put the handoff in a folder and deploy that folder with the CLI to preserve its paths. A root
index.htmlopens as a website instead of the file explorer. Keep it out of the root when your goal is source browsing.Publish from your browser or terminal
In your browserGo to uploaderDrop, publish, copy the link.
Drop your finished files into the uploader above, or select them from your device. Enter your email if signed out, then choose "Publish files".
Selected files need unique names and publish at the top level. Use the CLI for folders; the browser uploader does not accept folders or extract ZIPs.
TerminalNode.js 20+One command. Files or folders.
npx -y @getflat/cli deploy ./summary.tsReplace the example path with your file. Pass a folder to publish related files with their relative paths intact. The CLI prints the published URL.
Check before sharing
Open the published link and select each source file. Check highlighting, special characters, and original downloads. Verify the example locally if you are providing instructions for someone else to run it.
Signed-out uploads expire after 1 hour by default. Sign in before expiry to keep them online, or sign in before publishing for no default expiry.
What you can share with Source code hosting
Small reproduction examples
Share the source and setup notes for a reported problem. A recipient can inspect the files before downloading them into their own environment.
Code walkthroughs and handoffs
Give a colleague or learner a saved source snapshot with line numbers and original files. Keep discussion and feedback in your existing conversation.
Keep a version, or keep an address.
Share this version
Every upload gets its own link. Publishing revised files creates a new link and leaves the earlier version unchanged. Use the version link when someone needs to review a specific upload.
Update files at one address
Use a named onflat.page address or your own domain. Sign in, then publish with the CLI using --domain. Publish revised files with the same domain to point that address to the new upload.
Named addresses are included on Free. Adding your own domain requires a paid plan. The browser uploader does not set up or repoint these addresses.
Source code hosting questions
Is hosting free, and what are the limits?
Yes. Signed-in Free includes 5 MiB per upload, 1 GiB of storage, and 5 GiB of monthly transfer, with no default expiry. The per-upload limit covers all files in that upload. Paid plans raise these limits.
Do readers need a Flat account?
No. Public links open without a Flat account. Anyone with the link can open the uploaded files. Password-protected links also require the visitor password.
Can I password-protect my upload?
Yes. Password protection is available on every plan. Add --password YOUR_PASSWORD to your CLI deploy command. It protects access to the upload and its files, but does not prevent someone with access from saving a copy. The browser uploader creates public uploads.
Can I replace files without changing the link?
A version link always refers to its original upload. For same-address updates, use a named address or your own domain. Publish revised files with the same --domain value in the CLI to point that address to the new upload.
What happens when an upload expires?
Flat stops serving it. An expired upload cannot be recovered. Signed-out uploads expire after 1 hour by default. For browser uploads, use the sign-in link shown after publishing. For CLI uploads, run npx -y @getflat/cli login. Complete sign-in before expiry to keep the upload online. If you chose a shorter expiry in the CLI, that deadline stays in place.
Which source-code files have highlighting?
Recognized files include JavaScript and TypeScript, including JSX and TSX; Python, Ruby, PHP, Java, Kotlin, Swift, Go, Rust, C, C++, and C#; shell scripts; SQL and GraphQL; CSS, SCSS, Sass, and Less; and Vue and Svelte source.
The filename extension selects the grammar. Examples include .js, .ts, .py, .php, .go, .rs, .sql, and .sh. Highlighting does not compile, lint, or validate the program. Unsupported extensions may use the download view.
Will Flat run my Python, PHP, or Node.js application?
No. Flat hosts the uploaded files and displays source. It does not provide Python, PHP, Node.js, server processes, or a database runtime. The original URL returns the stored file, not the result of executing it.
Can I publish a working frontend instead of its source?
Yes, if it is a static website. Build it with your own tools, then publish the generated HTML, JavaScript, and assets. Browser JavaScript can run on that website. See HTML hosting for the finished-output workflow. Uploading TypeScript, JSX, or framework source alone does not build an application.
Is this Git hosting or a code-review tool?
No. Flat shares file snapshots. It does not provide Git clone or push, branches, commits, pull requests, inline review comments, or diffs between uploads. Use your repository for development and publish a selected snapshot for reading.
Can I share a folder with code and documentation?
Yes. Put the intended files in a folder and publish it with the CLI:
npx -y @getflat/cli deploy ./source-exampleRelative paths stay intact. Markdown notes appear as source, and a root index.html takes priority over the explorer. The browser uploader accepts individual files with unique names rather than folders.
Where do JSON, Markdown, and configuration files belong?
They can accompany your code in the same upload. The text hosting guides explain their format-specific behavior. Markdown and MDX remain source, and configuration files do not apply settings or run workflows.
How large can an upload be?
Upload allowances depend on your plan and cover all files in the upload. Compare current plan limits. Preview availability also depends on format and processing support. The original file remains available to download if a preview is unavailable.
Can I embed the viewer on another website?
Flat's generated viewer cannot be embedded in an iframe and keeps Flat branding on every plan. Link to the viewer for reading or to the exact file URL for the original.
Another text format?
Find the guide for your text file.
Give your Source code files a link.
Publish your file, check the preview, and share the URL.
Publish filesFree to start · View pricing
