Share code that's a joy to read: syntax highlighting, line numbers and a real code editor

How to share code on Thpaste — 14 highlighted languages, line numbers, tab indenting, a live preview, one-tap copy, raw view and downloads — plus tips for sharing logs, configs and stack traces.

Thpaste team · 4 min read
Share code that's a joy to read
On this page
  1. Write code in a real editor
  2. Supported languages
  3. What readers get
  4. Sharing logs, configs and stack traces
  5. Automate it
  6. FAQ

Pasting code into a chat app is a recipe for mangled indentation, smart quotes and a wall of grey text. A Thpaste link keeps every space exactly where you put it, colours the syntax so it's easy to scan, and numbers the lines so people can say "look at line 42". Here's everything the Code format can do.

14languages with syntax highlighting
512 KBper paste — enough for big logs and files
1 tapto copy the whole paste
0sign-ups needed to share a snippet

Write code in a real editor

Pick Code in the composer and choose a language. The editor is built for code, not prose:

The code editor
Line numbers, wrap, text size and indent options — and Tab indents instead of jumping away
Editor featureWhat it does
Line numbersA gutter that scrolls with your code
Tab / Shift+TabIndent or outdent the line — or every selected line
Smart EnterNew lines keep the indent, and add one after {, [, ( or :
Indent with2 spaces, 4 spaces or a real tab
Wrap linesTurn long lines into wrapped lines while you write
SizeEditor text from 12 to 20 px
PreviewSee exactly how the highlighted paste will look before publishing
The highlighted preview
Preview shows the highlighted result before you publish

Supported languages

WebBack endData & configShell & systems
JavaScriptPythonJSONBash / Shell
TypeScriptGoYAMLC / C++
HTMLRustSQL
CSSJava · PHP

Writing documentation with code in it? Use Markdown instead and put code in fenced blocks — they're highlighted with the same engine. See the Markdown guide.

What readers get

A shared code paste
A published JavaScript paste: highlighting, line numbers and a Copy button
Highlighting

Keywords, strings, numbers and comments in distinct colours, tuned for light and dark themes.

Line numbers

Easy to point at a line in a review or a support chat.

Copy

One tap copies the whole paste, exactly as written.

Clickable links

URLs inside code and comments become links.

Raw view

thpaste.com/raw/<id> serves the plain text — perfect for curl and scripts.

Download

Add ?dl=1 to the raw link to download it as a file.

Fetch a paste from the command line

curl -s https://thpaste.com/raw/<id> -o notes.txt saves any paste's text to a file — handy on servers with no browser.

Sharing logs, configs and stack traces

You're sharing…FormatTip
A stack trace or build logPlain text or BashPlain text keeps it untouched; Bash adds light colouring
A config fileYAML, JSON or the file's languageLine numbers make "change line 12" easy
A database querySQLKeywords pop, so long queries are readable
A snippet with an explanationMarkdownText and fenced code blocks together
Secrets in a configAny — plus a password and burn after readingSee private sharing

Don't share secrets in the open

API keys, passwords and tokens in a public paste are visible to anyone with the link. Strip them out — or protect the paste with a password and make it burn after reading.

Automate it

Developers can create code pastes from scripts and CI with the API — for example, piping a test log straight into a new paste:

make test 2>&1 | jq -Rs '{title: "Test run", language: "bash", content: .}' | \
  curl -s -X POST https://thpaste.com/api/v1/pastes \
    -H "Authorization: Bearer tp_YOUR_KEY" \
    -H "Content-Type: application/json" -d @-

The full walkthrough: getting started with the Thpaste API.

FAQ

My language isn't listed — can I still share it?
Yes. Choose plain text: it keeps every character and space exactly, just without colours.

Are tabs preserved?
Yes. Pastes store exactly what you typed, tabs included.

Can I edit a code paste after publishing?
With a free account, yes — the title and code are editable and the link stays the same.

Share your next snippet

Pick Code, choose the language and publish — no account needed.

Paste code

Share something now

Rich text, Markdown or code — get a short link in seconds. No account needed.

Create a paste

Keep reading

Guide · 5 min read

Everything Thpaste can do: the complete feature tour

A guided, screenshot-by-screenshot tour of every Thpaste feature — rich text, Markdown and code pastes, private sharing, translation, link previews, analytics, profiles, Creator Mode and the API.