.bas

11 claimants 7 primary 2 secondary shared primary (7)

SWH popularity

From the SWH-MSR-ARV dataset (Desmazières, Di Cosmo, Lorentz, MSR 2025; file nb_extensions_alphanum.csv) — one row per (ext, year) in the full SWH archive. Case-aggregated. citation.

641.7K
total occurrences
176.1K
since 2019 (27.4%)
1970–2023
years active

Case variants in archive: .bas (587.3K), .BAS (53.2K), .Bas (1.2K), .bAS (4) — aggregated above.

Attribution status

This extension is attributed to B4X; BASIC; BASIC; 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
Small Basicwikipediaproposed
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 languageUse as new PL ↗
AmigaBASIC source Q105858496
file format
file formatapplication/octet-streamUse as new PL ↗
AmigaBASIC source (protected) Q105859238
file format
file formatapplication/octet-streamUse as new PL ↗

Disambiguation rules (7)

Linguist heuristics that decide, by content, which language a .bas file actually is.
RulePredictsKindPredicates (truncated)
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. Useful for deciding what this extension actually is when the attribution is uncertain.
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)