BASIC256 is a small, approachable language that lets a beginner gradually grow into graphics, simulation, games and systems programming.
BASIC256 is a free, open-source BASIC programming environment for beginners and hobbyists. It is the actively maintained continuation of the original BASIC256, modernized for Windows, Linux, macOS and the Web while retaining compatibility with existing BASIC256 programs.
- Designed specifically for beginners and hobbyists
- Simple BASIC syntax
- Immediate graphics and sound
- Cross-platform desktop and Web versions
- Many example programs to learn from and experiment with
- Free and open source under GPLv3+
No installation is needed. The WebAssembly version provides the full editor and interpreter directly in your browser.
For example:
# bubbles.kbs — random transparent colorful circles
clg
fastgraphics
for i = 1 to 500
color rgb(int(rand*256), int(rand*256), int(rand*256), 100+int(rand*150))
circle rand*graphwidth, rand*graphheight, rand*40
refresh
next iThe browser version supports several useful URL modes:
| URL parameter | Purpose |
|---|---|
?run=name |
Run a bundled Example |
?url=path/file.kbs |
Load a program from the site |
?src=... |
Load source encoded in the URL |
&mode=ide |
Full IDE, auto-run |
&mode=edit |
Full IDE, loaded but not run |
&mode=graph |
Graphics-only mode |
&mode=text |
Text-only mode |
&mode=app |
Text + graphics, without the editor |
For example:
https://run.basic256.org/?run=Mandelbrot-256&mode=graphhttps://run.basic256.org/?run=BubbleUniverse_variations
This makes the Web version useful not only for learning, but also for sharing and embedding BASIC256 programs.
Copy the WASM build to any static host served over HTTPS, and send these two headers that the multithreaded build relies on:
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
With those in place the page loads in a single pass — no reload — and the bundled coi-serviceworker helper (only needed because GitHub Pages can't send those headers itself) is no longer required.
The browser runs inside a sandbox, so some desktop features are unavailable:
- Files created by a running program exist only for the current browser session.
- Programs in the editor persist across refreshes.
SOUND,SAYand related features use browser audio/speech support and could be unavailable.- TCP networking,
SYSTEM, serial ports, database/SQL and printer commands are unavailable. - Large fractals and simulations generally run slower than on the desktop.
- Media such as
SOUNDLOADandIMGLOADcan be loaded from paths relative to the Web page, subject to normal browser CORS rules.
- Toolkit Module: New
Modules/toolkit.kbs(INCLUDE "toolkit.kbs") draws a classic-style interface on the graphics output: buttons, checkboxes, radio buttons, sliders, spin boxes, tabs, group boxes, drawing fields and editable text fields, each with a hit-test function for mouse clicks.CALL tk_help()lists them all. - New Examples:
Examples/GUI-Demoshows each toolkit element at work, and a series of Falling Sand programs builds up the final program step by step.Examples/Funaddsbalgame256.kbs, a ball-catching game played with the mouse, andFallingLetters.kbs, a falling-letters rain effect. - Mouse Clicks:
CLICKX,CLICKYand double-clicks now work across a graphics window scaled up byGRAPHSIZEor zoomed from the View menu, reporting the graphics pixel under the pointer. A negative scale shows the whole picture turned round.
ARRAYADDAdded: Appends to the end of an array — a value to a 1D array, a row to a 2D array (ARRAYADD points, x, y) — and turns an empty variable into an array, so tables can be built in a loop withoutDIM.- Module Prefixes (breaking): Every routine in the bundled modules now carries its module's prefix —
ma_formath.kbs,tu_forturtle.kbs,tk_fortoolkit.kbs— and each module has a help routine (ma_help,tu_help,tk_help). Programs from 2.3.0 must use the new names (e.g.ma_hypot,tu_forward). - Number Range: A whole-number literal too big for 64 bits is now reported as "Number too large" at compile time.
- Dark Theme: View/Theme/Follow System turns the whole IDE dark when the OS is in dark mode — menus, toolbars, docks, dialogs and the Variable Watch window included. Windows 10 uses the Fusion style while dark.
- Save As: Opens in the program's own folder with its name filled in. Examples are never overwritten — saving one asks for a new name, and the Examples folder cannot be chosen as a save location.
- Overwrite Warning: New preference, Warn when overwriting an existing file (on by default). Untick it to let Save write straight back to the program's own file. The old Automatically save program when it is successfully run option has been removed.
- Raspberry Pi: The Pi archive now includes the
TestSuiteand the benchmark. - Windows Installer: The installer and uninstaller detect a running BASIC256 and offer Retry/Cancel instead of failing on
basic256.exe.
- File Access Prompts: Accessing files/folders outside the program's root directory now triggers a user confirmation prompt (
OPEN,KILL,MKDIR,IMGSAVE,DBOPEN, SQL targets, etc.). - Loopback Network Default:
NETLISTENnow listens exclusively on127.0.0.1by default. Network access can be enabled in Preferences/Advanced. - Directory Commands:
MKDIRrestored (works withoutSYSTEM).RMDIRhas been permanently removed for safety.
TEXTSCREENAdded: Convert the Text Output window into a true grid-based character screen with fixed dimensions and optional square cells (TEXTSCREEN cols, rows [, square]).- Console Controls:
LOCATEpositions the cursor for in-place overwriting. AddedTEXTCOLOR,TEXTBACKGROUND,TEXTFONT, andTEXTCHAR().
- Color & Sprites: Added
HSV(h, s, v [, a])color function, 3D Noise support viaNOISE(x, y, z), andSPRITETEXTto render text directly onto sprites. - Sprite Scaling:
SPRITEWandSPRITEHnow accurately report transformed dimensions. - Coordinate Mapping:
IMGLOAD,GETSLICE, andPUTSLICEnow respect customWINDOWcoordinates.
- Array Sorting: New built-in
SORTstatement for 1D and 2D arrays (SORT array [, col] [, ASCENDING|DESCENDING] [, IGNORECASE]). - Subroutine Pass-by-Reference Fix: Subroutines declaring
ref()parameters now correctly modify the caller's target variable passed without an explicitref()wrapper. - Syntax Improvements: Fixed an issue where statements without arguments followed by a colon (e.g.,
NEXT:,CLS:) were misidentified as labels.
- Raspberry Pi: Fixed missing SQLite driver error for
DBOPEN. - Benchmarking & Examples: Added
TestSuite/Benchmarkutility and a new SQLite console demo (Examples/DataBase/GamesDB.kbs).
- Gallery Page There is now a Gallery page on basic256.org where you can run the examples directly in a pop-up Browser window.
- Execution Speedup: Overall execution is 20–25% faster due to optimized runtime value handling across arithmetic, drawing, and array operations.
- Array Optimization: Arrays use ~50% less memory. Whole-array operations (
DIM,REDIM, array copying,MATstatements) run 3–5x faster.
- Vector Operators: Added
DOT,CROSS,NORM(v), andUNIT(v)for vector arithmetic on standard 1D/2D arrays. - Matrix Operators: New
MATstatement adds following matrix operations:MUL,ADD,SUB,INVandTRN. - Turtle Graphics Module: Added
Modules/turtle.kbs(INCLUDE "turtle.kbs") for turtle-style relative drawing (t_forward,t_left,t_goto, etc.). FRAMERATEControl: NewFRAMERATE fpsstatement locks drawing loops to a target frame rate (e.g.,FRAMERATE 60), automatically adjusting for system speed differences.- OpenSimplex noise: Added
NOISEfor smooth, repeatable OpenSimplex noise (ideal for terrain, clouds, and paths). Tied toSEEDfor deterministic output.
- Unlimited File Size: Removed the ~5,000-line program length limit (including
INCLUDEfiles). - Improved
PAUSE: Accurate millisecond-level precision across all platforms; instantly interruptible by clicking Stop. - Syntax Adjustments:
MODis now a case-insensitive keyword (reserved word).
WINDOWStatement: Set custom coordinate systems and axis orientations (WINDOW x1, y1, x2, y2), with middle-point centering or graph paper orientation.MOUSEX,MOUSEY,PIXEL, etc. adapt automatically.- Subpixel Drawing: Graphics statements (
PLOT,LINE,CIRCLE,RECT,TEXT, etc.) now accept fractional coordinates for precision positioning.
- Multi-line Literals: Array and map literals (
{ ... }) can now span multiple lines with inline comments (#), allowing clean table and matrix layouts.
- Faster Execution: Arithmetic-heavy loops run roughly 2x faster due to internal memory reuse for intermediate values and reduced interpreter step overhead. Gains are highest in the WASM/browser build.
- Session Persistence: Editor state, open tabs, active selection, and file names now auto-persist in the browser across tab closes, page refreshes, or browser restarts.
- Windows 11 Scaling: Menu bar titles (
File,Edit,View, etc.) now properly scale and adjust spacing based on system text size settings. - Streamlined Windows Installer: Removed the redundant standalone Microsoft VC++ Redistributable installer file (still bundled within the main installer when needed).
- Updated Links: Updated Help/About to include the main site (
https://basic256.org) alongside the documentation portal.
Major Update: BASIC-256 has migrated to Qt 6, enabling WebAssembly (WASM) browser execution, modern UI features, and relicensing to GPL v3 or later.
- Qt 6 & WASM Support: Ported codebase to Qt 6 and CMake. You can now run BASIC-256 directly in a web browser!
- UI Themes & Layout: Added Light, Dark, and Follow System themes (View/Theme). Window maximizing and docking now preserve balanced pane proportions.
- New
MAXIMIZEStatement: Programmatically maximize (MAXIMIZE 1) or restore (MAXIMIZE 0) the IDE window. - Mascot & Visuals: Introduced new program logo, transparent app icons across all platforms, and the BitBot mascot.
- Built-in Modules:
INCLUDEstatements now directly access bundled libraries (e.g.,include "math.kbs") in the browser.
- Mobile Audio & Touch: Full audio/speech support on iPad/iPhone and touch-driven interaction for browser demos.
- New CLI Flags:
-f(fullscreen run),-s(silent mode with suppressed screen output for background processing/testing), and-g(shows graphics pane only). - macOS Sequoia: Added official Intel macOS support (requires macOS 15+).
- New Documentation Portal: Replaced legacy docs with a modern Docusaurus site at
doc.basic256.org(accessible viaF1or Help/Online Help). - Documented Features: Added docs for
ELLIPSE,SETGRAPH,GETARRAYBASE, optionalLET, bit-shifts (<<,>>), and compound assignments (&=,;=).
The desktop application provides the familiar BASIC256 three-pane environment:
- Editor — write and edit BASIC programs.
- Text Output — program output and console-style interaction.
- Graphics Output — immediate drawing and animation.
The same BASIC256 programs can therefore be developed on the desktop and shared through the Web version.
Get the latest builds from the Releases page.
| Platform | Status | Notes |
|---|---|---|
| Windows | ✅ | ZIP and installer builds available. SmartScreen will initially block the installer as it comes from an unknown source — "More info" → "Run anyway" fixes this. |
| Linux x86 | ✅ | Tarball, AppImage and .deb packages. BASIC256 2.1.1 is in Debian 14 "Forky" main and in Debian Unstable "sid" main. |
| Raspberry Pi | ✅ | Tarball and AppImage builds. BASIC256 2.1.1 is in Raspbian Testing main. |
| macOS Apple Silicon | Requires macOS 15 (Sequoia) or newer. | |
| macOS Intel | Requires macOS 15 (Sequoia) or newer. Separate x86_64 build. | |
| WebAssembly | 🧪 | Usable, with the browser limitations described above. |
The supplied macOS applications are ad-hoc signed rather than notarized. If Gatekeeper reports that the application is damaged, try:
xattr -cr /Applications/basic256.appFor older macOS versions, the original Qt5-based BASIC-256 2.0.0.11 may be an alternative, or BASIC256 can be built from source against Qt 5.15.
The Raspberry Pi build is intended for modern Raspberry Pi Linux installations. Speech support may require speech-dispatcher to be installed separately.
BASIC256 can also run programs from a terminal:
| Short | Long | Effect |
|---|---|---|
| -h (-? on Windows) | --help | Display command-line help. |
| --help-all | Display command-line help including Qt-specific options. | |
| -v | --version | Display the BASIC-256 version. |
| -r | --run | Load and run the specified .kbs program. Must precede the filename. |
| -a | --app --application | Load and run the specified .kbs without the Edit window. |
| -g | --graph | Load and run the specified .kbs with only the Graphics window. |
| -t | --text | Load and run the specified .kbs with only the Text window. |
| -f | --full | When used with -r/-a/-t/-g, the full screen area will be used. |
| -s | --silent | Run the specified .kbs with no GUI at all: PRINT goes to stdout, errors to stderr, and the exit code says whether it worked. Needs a filename, and cannot be combined with -r/-a/-g/-t. |
| -l | --lang --language | Start BASIC-256 using the specified language. |
For example:
basic256 -g Mandelbrot-256.kbs
basic256 -f -t Zork256.kbs
basic256 -s TestProgram.kbsThe repository contains a large collection of example programs covering graphics, games, mathematics, simulations, sound and other BASIC256 features.
The original minimal examples from BASIC256 2.0.0.11 are preserved under:
Examples/Original_Examples/
Additional examples can be found at Manuel Santos' BASIC256 blog.
BASIC256 includes 3 small standard libraries in the Modules folder. Every function and subroutine in a module starts with two letters and an underscore naming the module (ma_, tu_, tk_), which keeps its names apart from a program's own and from those of the other modules. Each module also has a help routine that prints what is in it.
- Modules/math.kbs
Use it with:
include "math.kbs"
call ma_help()It currently provides functions including:
ma_minarr, ma_maxarr, ma_sumarr, ma_avgarr, ma_sign, ma_min, ma_max, ma_lerp, ma_hypot, ma_atan2, ma_clamp, ma_map, ma_wrap, ma_dist, ma_fmod, ma_cbrt, ma_randint and ma_gaussian.
These are implemented as BASIC256 code rather than built-in language commands, keeping the language itself small while making common operations convenient.
- Modules/turtle.kbs
Use it with:
include "turtle.kbs"
call tu_help()This provides turtle logic with following subroutines:
tu_reset, tu_goto, tu_home, tu_forward, tu_backward, tu_right, tu_left, tu_setheading, tu_penup, tu_pendown, tu_x, tu_y, tu_getheading, tu_getpen
and short-codes tu_fw, tu_bw, tu_pu, tu_pd, tu_r, tu_l
- Modules/toolkit.kbs
Use it with:
include "toolkit.kbs"
call tk_help()This draws a classic-style interface on the graphics output. Each element has a subroutine that draws it and a function that tells whether a mouse click landed on it; the program keeps the state and redraws an element when it changes:
tk_button / tk_buttonhit, tk_checkbox / tk_checkhit, tk_radio / tk_radiohit, tk_slider / tk_sliderhit / tk_sliderval, tk_spinner / tk_spinhit, tk_drawtabs / tk_tabhit, tk_grouper, tk_drawing / tk_drawhit
and the text field tk_textfield / tk_texthit, with tk_textcaretat, tk_textedit$ and tk_textcaret for clicking, typing and moving the caret.
The programs in Examples/GUI-Demo show each element at work.
Upgrading from 2.3.0: the module prefixes are new in 2.3.1. A program that still calls the old names (
sumarr,hypot,t_forward, ...) stops with an error; rename the calls toma_sumarr,ma_hypot,tu_forwardand so on. Two names change by more than the prefix:remapis nowma_map, andfroundhas been removed.
Detailed build instructions are in:
The project uses CMake, Qt6 and GitHub Actions, with builds for Windows, Linux, Raspberry Pi, macOS and WebAssembly.
BASIC256 began as KidBasic in 2006, created by Ian Paul Larsen and later maintained by James Reneau and other contributors through SourceForge. The original project eventually became BASIC256 and reached version 2.0.0.11.
This repository is a continuation of that project. It started from the 2.0.99.10.2 development branch with the goal of modernizing the codebase while preserving its educational character and compatibility.
The major development steps have been:
- 2.1.0 — modern build system, portability and new platforms.
- 2.1.1 — significant performance improvements and Web persistence.
- 2.2.0 — new language features, mathematics, graphics capabilities and further performance improvements.
- 2.3.0 — safer system access and enhanced text-console capabilities.
- 2.3.1 — the GUI toolkit module, prefixed module names,
ARRAYADD, a dark IDE that follows the system theme, and safer saving.
The original copyright notices have been retained.
Development continues with an emphasis on education, portability, performance and compatibility.
Current areas of interest include:
- More distribution packages
- More standard modules
- More and better examples
- Educational tutorials
- New language features where a module would be too slow
- Continued improvements to documentation and deployment
BASIC256 is a hobbyist/open-source project and contributions are welcome.
You can help by:
- Reporting bugs
- Improving documentation
- Writing examples
- Translating documentation
- Testing releases
- Improving tutorials
- Submitting pull requests
Use:
- Issues for bugs and feature requests
- Discussions for questions, ideas and projects
- Discord to join the community
BASIC256 is distributed under the GNU General Public License version 3 or later (GPLv3+).
The original project used GPLv2 "or (at your option) any later version", allowing this continuation to move to GPLv3+. See license.txt for the full license.
Two components retain their compatible original licenses:
src/core/md5.cpp/md5.h— RSA Data Security code adapted by Frank Thilosrc/gui/LineNumberArea.cpp/.h— BSD-licensed code from the Qt examples
BASIC256 is maintained as a hobbyist/open-source project with the help of modern AI development tools. Contributions to the code, examples, documentation and translations are especially welcome.


