Skip to content

Guide · Open source

How to use Carbon: make beautiful code images online

Updated · written with AI from the project's own documentation and checked against our catalogue data

Carbon is a free, open-source web app from carbon.now.sh that turns a code snippet into a styled image for tweets, blog posts and slides. This guide shows you how to import code, customize the look, export or share the result, and embed it on your own site. No installation is required to start, since Carbon runs in the browser.

Carboncarbon-app/carbon · ★ 36.1k · MIT

Quick start

  1. 1Open Carbon. Go to carbon.now.sh in your browser. No account is needed to start.
  2. 2Add your code. Drop a file onto the editor, paste code, or append a GitHub gist ID to the URL.
  3. 3Customize the image. Pick a syntax theme, background, window theme, padding, shadows and font.
  4. 4Export or copy. Download as PNG or SVG, use Export → Open, or copy with Copy → Image.
  5. 5Share or embed. Create a saved snippet and share its link, or use the embed URL on your site.

Import your code into Carbon

Carbon gives you three ways to get code into the editor. You can drop a file onto the editor, append a GitHub gist ID to the URL, or simply start typing or pasting.

  • Drop a file onto the editor
  • Append a GitHub gist ID to the URL
  • Type or paste directly into the editor
carbon.now.sh/<gist_id_goes_here>

Customize the look of your image

Once your code is in Carbon, you can change how the image looks. The source lists syntax theme, background color, window theme, padding, shadows and fonts as the main options.

  • Syntax theme: how code is colored
  • Background color
  • Window theme
  • Padding and shadows
  • Fonts

Export or copy the image

When the image looks right, you can save it or copy it. Carbon supports downloading as PNG and SVG. You can also open the image directly in the browser, or copy it to your clipboard.

  • Download as PNG or SVG
  • Export → Open to view the image in the browser
  • Copy → Image to copy it to the clipboard

To keep a link you can edit later, create a saved snippet. Sign in with the "Sign in/Sign up" button, edit as normal, and your snippet is saved automatically. Copy the URL from your browser to share it. Shared saved snippets are automatically unfurled on Twitter and Slack, so viewers see the image and can open the source code from the link.

  • Click "Sign in/Sign up"
  • Edit normally; the snippet saves automatically
  • Copy the browser URL and share it

Embed a snippet on your website

The README calls embedding the recommended method for sharing Carbon on your own website or blog. Use the carbon.now.sh/embed URL for any Carbon snippet. The Copy Menu gives you an iFrame snippet, or an encoded URL for platforms like Medium. You can also embed saved snippets or GitHub gists with carbon.now.sh/embed/:id.

  • Any snippet: carbon.now.sh/embed
  • Saved snippet or gist: carbon.now.sh/embed/:id
  • Copy Menu provides the iFrame code or encoded URL
carbon.now.sh/embed/:id

Use Carbon offline as an installed app

If you use Google Chrome, or another browser that supports Progressive Web Apps, you can install Carbon for offline use. The README describes this as installing the same site, not a separate program.

  • Visit carbon.now.sh
  • Open your browser's settings menu
  • Click "Install Carbon..."

What people use it for

  • Posting a code screenshot on Twitter or in a blog post
  • Preparing code examples for a presentation or class
  • Turning a GitHub gist into a shareable image
  • Embedding a styled code snippet on your own website

Frequently asked questions

Is Carbon free and open source?

Yes. The project is released under the MIT licence, and the source is on GitHub. The README does not list any pricing.

Do I need to install anything to use Carbon?

No installation is needed to use Carbon at carbon.now.sh. The README lists no prerequisites. An offline version is available as a browser install of the same site in browsers that support Progressive Web Apps, such as Google Chrome.

Can I use a GitHub gist with Carbon?

Yes. Append the gist ID to the URL, for example carbon.now.sh/<gist_id_goes_here>, and the gist's code loads into the editor.

What file formats can I export?

Carbon supports downloading your image as PNG and SVG. You can also copy the image to your clipboard with Copy → Image.

Can I run or edit code in Carbon?

No. Carbon only formats and renders source text as an image. It is not a full code editor and does not run code.

What are good alternatives to Carbon?

The project's comparable projects include ray.so, Silicon, codeimage and CodeSnap. Compare them on the options you need, such as themes, export formats and whether you need a hosted or self-hosted tool.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Carbon suits developers, teachers and students who want clean, good-looking code images quickly, especially from GitHub gists. It is a poor fit if you need a fully offline or self-hosted tool, or a real editor that runs code, so consider the alternatives listed above in those cases.

Install options & downloads