How to Create a Code Image with Carbon

Updated

Carbon (carbon.now.sh) turns source code into a shareable image. You can start by typing directly into the text area or dropping a file into it, then adjust the appearance with the Theme, Language, and Background menus, and finish with Export or Quick export. This works for anyone who wants a clean code screenshot for a post, slide, or message — no design tool required.

Getting started

  1. Open carbon.now.sh.
  2. Either start typing in the text area or drop a file into it. The page states: "Start typing or drop a file into the text area to get started."
  3. The code you enter becomes the content of the image.

Adjusting the look

Carbon exposes several controls in its menus:

  • Theme — changes the color scheme of the code.
  • Language — sets syntax highlighting for the code you entered.
  • Background — changes the backdrop behind the code window.
  • Settings — additional appearance options.

Set Language to match your code so highlighting is accurate, and pick a Theme and Background that keep the code readable against the background.

Exporting and sharing

When the image looks right, use one of these:

  • Export — full export options.
  • Quick export — a faster export path.
  • Copy — copy the result.
  • Tweet — share to Twitter/X.
  • Share — share the image.

Common snags

  • If highlighting looks wrong, check the Language menu — it may not match the code you pasted.
  • If the code is hard to read, change the Theme or Background rather than editing the code itself.
  • Dropping a file only works if the file contains the code you want; otherwise type or paste it into the text area.

Carbon also offers Sign in/up, and links to about, source, terms, privacy, and offsets, created by @carbon_app.