.bas

11 claimants 7 primary 2 secondary shared primary (7)

SWH popularity

Distinct files in the full Software Heritage archive (2026-06-04 export), dated by first appearance, following Desmazières, Di Cosmo, Lorentz (MSR 2025). Case-aggregated. citation.

804.0K
total files
262.4K
first seen 2021–2025 (32.6%)
2019
median year (half its files since)

Case variants in archive: .bas (730.2K), .BAS (72.4K), .Bas (1.4K), .BAs (5), .bAS (4), .bAs (2), .BaS (1), .baS (1) — aggregated above.

Attribution status

This extension is attributed to B4X; BASIC; FreeBASIC; QBasic; QuickBASIC; VBA; Visual Basic 6.0 as primary by 9 authoritative claims.

Authoritative sources: ✓ Linguist ✓ Pygments ✓ Wikidata · Q42979 △ Wikipedia · secondary

Disagree or have a correction? Open a labelling issue.

Claimants (20)

Languages that list .bas among their extensions. Strength reflects whether the upstream source treated it as their primary extension.
LanguageSourceStrength
B4Xlinguistprimary
BASIClinguistprimary
BASICpygmentsprimary
BASICwikidataprimary
FreeBASICwikidataprimary
QBasicpygmentsprimary
QuickBASIClinguistprimary
VBAlinguistprimary
Visual Basic 6.0linguistprimary
B4Xpygmentssecondary
FreeBASIClinguistsecondary
FreeBASICpygmentssecondary
QuickBASICpygmentssecondary
VBApygmentssecondary
Visual Basic .NETpygmentssecondary
Visual Basic 6.0pygmentssecondary
visual-basicpygmentssecondary
Liberty BASICwikipediaproposed
SmallBASICwikipediaproposed
Visual Basic .NETwikipediaproposed

Wikidata says… (22)

File formats, image formats, audio codecs and other non-PL entities that claim .bas on Wikidata (property P1195) or in the Wikipedia infobox. Source: data/derived/external_extension_index.csv. Click Use as new PL on any row to open the Add-PL form pre-filled with that entry's name, Wikipedia/Wikidata URL, and this extension — one submission creates the PL + claim.
Right entry isn't listed? Add manually ↗
FormatClass (Wikidata P31)Suggested labelMIMENotesAction
FreeBASIC Q195929
compiled programming language
free software; programming language———Use as new PL ↗
AmigaBASIC source Q105858496
file format
file format—application/octet-stream—Use as new PL ↗
AmigaBASIC source (protected) Q105859238
file format
file format—application/octet-stream—Use as new PL ↗

Disambiguation rules (7)

Linguist heuristics that decide, by content, which language a .bas file actually is.
RulePredictsKindPredicates (truncated)Measured on SWH
h/linguist/.bas/0B4Xpredicates[{"kind": "any", "regexes": ["\\A\\W{0,3}(?:.*(?:\\r?\\n|\\r)){0,9}B4(?:J|A|R|i)=true"]}]
h/linguist/.bas/1FreeBASICpredicates[{"kind": "any", "regexes": ["(?i)^[ \\t]*#(?:define|endif|endmacro|ifn?def|include|lang|macro|pragma)(?:$|\\s)", "(?i)^[ \\t]*dim( shared)? [a-z_][a-z0-9_]* as [a-z_][a-z0-9_]* ptr"]}]
h/linguist/.bas/2FreeBASICpredicates[{"kind": "any", "regexes": ["(?i)^[ \\t]*return "]}, {"kind": "not_any", "regexes": ["(?i)[ \\t]*gosub "]}]
h/linguist/.bas/3BASICpredicates[{"kind": "any", "regexes": ["\\A\\s*\\d"]}]
h/linguist/.bas/4QuickBASICpredicates[{"kind": "any", "regexes": ["^[ ]*(CONST|DIM|REDIM|DEFINT|PRINT|DECLARE (SUB|FUNCTION)|FUNCTION|SUB) ", "(#|$)lang:?\\s*\"?qb\"?", "(?i)'\\$INCLUDE:", "(?i)^[ ]*CLS[ ]*('|:|\\r|\\n)", "(?i)^[ ]*OPTIO
h/linguist/.bas/5VBApredicates[{"kind": "any", "regexes": ["\\b(?:VBA|[vV]ba)(?:\\b|[0-9A-Z_])", "^[ ]*(?:Public|Private)? Declare PtrSafe (?:Sub|Function)\\b", "^[ ]*#If Win64\\b", "^[ ]*(?:Dim|Const) [0-9a-zA-Z_]*[ ]*As Long(?:P
h/linguist/.bas/6Visual Basic 6.0predicates[{"kind": "any", "regexes": ["^[ ]*Attribute VB_Name = "]}]

SWH-mined examples (1)

Real archived programs with this extension, byte-verified against the SWH archive, grouped by predicted language and by how the prediction was made. Useful for deciding what this extension actually is when the attribution is uncertain.
QuickBASIC (1) — 1 via Linguist heuristic
Whilewend.Bas · 146 B · seen 24× in SWH
predicted: QuickBASIC via heuristic
swh:1:cnt:996e120260a35c6f6ef02607ce64a9b4741876fc;origin=https://github.com/surveydude/Gillespie-BASIC;anchor=swh:1:rev:83686565dbcf5fa5b47b79464ede407b9673356b;path=/Demos_New/Whilewend.Bas
Open in SWH · Raw bytes
Request more SWH-mined examples
If the examples above don't disambiguate what .bas is, request a fresh mining run.
(or open the pre-filled issue directly)