What is the PB file format?
A .pb file is a PureBasic source code file - plain text written in the PureBasic programming language, developed by Fantaisie Software (Frédéric Laboureur) since 1998. PureBasic is a compiled, procedural BASIC-dialect language that produces native binaries for Windows, Linux, macOS, and historically AmigaOS.
.pb files contain the full source of a PureBasic program or module: Procedure/EndProcedure blocks, Macro definitions, module declarations (DeclareModule/Module), compiler directives (CompilerIf/CompilerEndIf), and XIncludeFile statements that pull in additional source files. Comments begin with a semicolon (;). Keywords are case-insensitive. The PureBasic IDE saves files as UTF-8 with BOM on Windows by default.
Compiled output is a separate native binary - .exe on Windows, .so or .dylib on Linux/macOS - so .pb files contain only human-readable source code. The bundled PureBasic IDE provides syntax highlighting, an integrated debugger, and a GUI form designer. Visual Studio Code can also edit .pb files with community-supplied syntax extensions.
Note on naming collisions: .pb is also widely used for Protocol Buffers compiled binary data (Google's serialization format), and was historically used by PowerBASIC for source files (most BASIC dialects use .bas as their default extension). When encountering a .pb file, the surrounding project structure and content determine which format it represents. Current PureBasic is at version 6.x (2024).
Security & safety
RISK: MEDIUMA .pb file claimed to be PureBasic source is plain text and harmless to open in a text editor. If you received an unsolicited .pb file as a binary blob (Protocol Buffers), it is data, not executable. However, malicious actors occasionally rename executable files to unexpected extensions - verify the file type with a hex editor if the source is untrusted.
Format details
in a nutshell- Protocol Buffers binary data (Google protobuf) - Google's Protocol Buffers serialization format stores serialized binary messages as .pb files; these are binary (not text) and require a .proto schema to decode.
- PowerBASIC source file - PowerBASIC (Windows BASIC compiler by PowerBASIC Inc.) also used .pb for source code; company effectively ceased operations ~2020 and the product is considered abandonware.
- EPICS Archiver Appliance raw data - EPICS Archiver Appliance uses .pb as its custom binary storage format for raw physics instrument time-series data (unrelated to Protocol Buffers despite same extension).
Programs that open PB files
Technical details
deep spec| Language | PureBasic (procedural BASIC dialect, native compiler) |
| Developer | Fantaisie Software (Frédéric Laboureur), since 1998 |
| File encoding | UTF-8 with BOM (Windows default in PureBasic IDE); also Windows-1252 |
| Comment syntax | Semicolon prefix (;) |
| Keyword case | Case-insensitive |
| Key constructs | Procedure/EndProcedure, Macro, DeclareModule/Module, CompilerIf/CompilerEndIf, XIncludeFile |
| Compiled output | Separate native binary (.exe on Windows, .so/.dylib on Linux/macOS); .pb file is source only |
| Target platforms | Windows, Linux, macOS (and historically AmigaOS) |
| Typical file size | 1 KB - 500 KB (source file; compiled binaries are separate) |
| Multi-file projects | XIncludeFile directive includes additional .pb source files at compile time |
| IDE support | PureBasic IDE (bundled, with debugger and form designer); Visual Studio Code (community extension) |
| Extension collision | .pb also used for Protocol Buffers binary data and PowerBASIC source files |
| Released | 1998 (PureBasic 1.0) |
| Latest version | PureBasic 6.x (2024) |
| Specification | www.purebasic.com |
PB conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about PB files.