.bc File Extension

Learn what a .bc file contains, how to open LLVM bitcode, how to distinguish a bc-language script, and what Poly supports.

File extension details for .bc

Storage Only
File typeLLVM bitcode or bc-language source
MIME type
EncodingUsually binary LLVM bitcode; occasionally plain-text bc-language source
Operating systemsWindows, macOS, Linux
Opens withLLVM llvm-dis, LLVM llvm-bcanalyzer, LLVM lli, GNU bc for text scripts
Poly supportYes. Poly stores, syncs, shares, versions, and downloads .bc files.
Indexed by PolyPartial. Poly indexes the filename and basic file properties, but not bitcode contents.
Preview in PolyNo. Download the file and inspect it with a compatible LLVM tool.
Poly agentNo. The Poly agent cannot read LLVM bitcode contents.

What kind of file is a .bc?

A .bc file is usually LLVM bitcode, the binary encoding of LLVM intermediate representation (IR). Compilers and analysis tools use it to preserve modules, functions, types, instructions, and metadata before generating machine code. The commonly used application/x-llvm MIME type is not registered by IANA.1

Raw LLVM IR bitcode starts with the bytes 42 43 C0 DE. A wrapped bitcode file instead starts with DE C0 17 0B. These signatures are useful clues, but LLVM cautions that a parser must still validate the complete stream.2

The suffix is ambiguous. Some projects also give .bc to plain-text programs for the Unix bc arbitrary-precision calculator. GNU bc accepts source files as command-line input, although it does not require this extension.3 Text that contains calculator statements is not LLVM bitcode.

Renaming a file to .bc does not create bitcode. Check the signature or use file before choosing a tool.

How do I open a .bc on my computer?

Install a compatible LLVM toolchain on Windows, macOS, or Linux. For LLVM bitcode:

  • llvm-dis module.bc -o module.ll converts it to human-readable LLVM assembly.
  • llvm-bcanalyzer module.bc displays its low-level block and record structure.
  • lli module.bc can execute a compatible program through LLVM's interpreter or JIT.

llvm-dis is usually the safest starting point because it produces readable .ll text.4 Avoid executing an unfamiliar file with lli. LLVM's security guidance says malicious bitcode can trigger arbitrary code execution in LLVM, so process untrusted compiler inputs in an isolated, patched environment.5

If the file is plain text instead, inspect it in a code editor and run it with bc filename.bc only when you trust the source.

Poly support for .bc

Poly stores, syncs, shares, versions, and downloads .bc files. It recognizes the LLVM convention and keeps the filename and ordinary file properties searchable.

Poly does not parse functions, symbols, instructions, or metadata from LLVM bitcode. There is no in-app preview, content-aware indexing, or agent reading for it. To make the IR readable and searchable as text, use llvm-dis to create a separate .ll file and keep the original .bc artifact alongside it.

History of .bc

LLVM began as Chris Lattner's research project and reached its 1.0 release in November 2003.6 The .bc suffix abbreviates bitcode. It became the conventional output name for LLVM's compact binary IR, while .ll identifies its textual assembly form.

Bitcode evolves with LLVM rather than an external file-format standard. Current LLVM policy promises that new releases can load bitcode produced by LLVM 3.0 and later, but older tools generally cannot read features introduced by newer producers.7

Working with .bc and alternatives

Choose the representation that suits the task:

NeedBetter choice
Compiler interchange or optimization.bc bitcode
Review, diffing, or text search.ll LLVM assembly
Final native linkingA target-specific object file
Reproducible long-term rebuildsSource, build files, and compiler version

Use llvm-as module.ll -o module.bc to assemble readable IR back into bitcode.8 Conversion is not guaranteed to erase target assumptions: a module can record a target triple, data layout, calling conventions, and architecture-specific features. Keep the producing LLVM version and target details with archived artifacts.

Footnotes

  1. Internet Assigned Numbers Authority. Media Types Registry. application/x-llvm is not registered.
  2. LLVM Project. LLVM Bitcode File Format.
  3. GNU Project. bc Command Manual: Description.
  4. LLVM Project. llvm-dis: LLVM Disassembler.
  5. LLVM Project. LLVM Security Response Group.
  6. LLVM Project. LLVM Old News and Release History.
  7. LLVM Project. LLVM Developer Policy: IR Backwards Compatibility.
  8. LLVM Project. llvm-as: LLVM Assembler.
© Poly Corp. 2026