Open Source
Completely free under GPL/LGPL license. Source code freely available on GitHub with an active developer community
FreeBASIC is a free and open-source BASIC compiler compatible with Microsoft QBASIC/QuickBASIC 4.5 syntax while introducing modern programming language features. It generates fast and efficient 32/64-bit native code for Windows, Linux, and DOS platforms.
| Feature | Description |
|---|---|
| 🎓 Beginner Friendly | Clean, intuitive syntax makes it excellent for learning programming |
| 🕹️ Nostalgia Compatible | Runs classic QBASIC programs and games perfectly |
| 🏗️ Modern Capabilities | Supports classes, objects, inheritance, polymorphism |
| ⚙️ Systems Programming | Supports pointers, memory manipulation, inline assembly |
| 🎨 Graphics Programming | Powerful built-in 2D graphics library for easy game development |
| 🌐 Network Programming | Built-in support for Socket, HTTP and networking features |
' Classic "Hello, World!" program
Print "Hello, World!"
Sleep' Simple file read/write
Dim f As Integer = FreeFile
Open "test.txt" For Output As #f
Print #f, "Hello FreeBASIC!"
Print #f, "Second line of data"
Close #f
' Read file contents
Open "test.txt" For Input As #f
Dim buf As String
While Not Eof(f)
Line Input #f, buf
Print buf
Wend
Close #f
Sleep' Bubble sort example
Dim arr(1 To 10) As Integer
Dim i As Integer, j As Integer, temp As Integer
' Initialize array
For i = 1 To 10
arr(i) = Int(Rnd * 100) + 1
Next i
Print "Before: ";
For i = 1 To 10: Print arr(i); " ";: Next i
Print
' Bubble sort
For i = 1 To 9
For j = i + 1 To 10
If arr(i) > arr(j) Then
Swap arr(i), arr(j)
End If
Next j
Next i
Print "After: ";
For i = 1 To 10: Print arr(i); " ";: Next i
Print
Sleep' Multithreading example
#include once "fbthread.bi"
sub mythread( byval p as any ptr )
print "hey! woeoio"
print "------------------------------------------------"
end sub
threaddetach( threadcreate( @mythread ) )
sleep 1
dim as long i,a
dim s as string
for i = 1 to 200
a += i
s += " + " & i
next
print s & " = " & aWrite and run FreeBASIC code directly in your browser without installation!
About This Documentation
This site provides complete FreeBASIC documentation in English, automatically synchronized and translated from the FreeBASIC Wiki:
Current documentation coverage: 789/807 pages
Community Resources
Official Site freebasic.net | Forum forum | Wiki wiki | GitHub github | Libraries libraries
Disclaimer
FreeBASIC is an independent open-source project with no affiliation to Microsoft Corporation.
BASIC, QBASIC, QuickBASIC and related trademarks are registered trademarks of Microsoft Corporation.
This documentation is provided for educational purposes only.