Welcome to XCODX Online Compiler
Quick Start:
Ctrl+Enter Run code
Ctrl+S Save / Download
Ctrl+L Clear output
Select a language and start coding.
Welcome to XCODX Online Compiler
Quick Start:
Ctrl+Enter Run code
Ctrl+S Save / Download
Ctrl+L Clear output
Select a language and start coding.
FreeBASIC is a free, open-source BASIC compiler started by Andre Victor around 2004, created first as a code-compatible replacement for Microsoft's QuickBASIC and then extended well past it. Its default dialect keeps familiar BASIC keywords like PRINT, INPUT, and DIM while adding pointers, unsigned types, user-defined types, and object orientation, and a separate QuickBASIC mode runs much older QBasic and QuickBASIC code with few changes. It compiles to native machine code rather than being interpreted, so BASIC programs become standalone executables, which has kept it popular for hobby games, demos, and small utilities. On XCODX your code is compiled with fbc (the version is shown in the badge) and run in a cloud sandbox, so you can try compiled BASIC without a local toolchain. It is not related to Visual Basic; the shared word BASIC names the syntax family, not the runtime.
Dim As Integer i, total = 0
For i = 1 To 10
total += i
Next
Print "Hello from FreeBASIC!"
Print "Sum of 1 to 10 ="; total
FreeBASIC's strengths are an approachable BASIC syntax that compiles straight to fast native code, close compatibility with old QuickBASIC programs, and low-ceremony control flow that is easy to pick up. Choose it to revive or port QBasic-era code, to write small console tools and hobby games, or as a gentle step from interpreted BASIC into compiled languages. It is a niche pick for team software or web and mobile development, where its community and library set are smaller than mainstream options. In this sandbox it suits console programs - loops, arrays, INPUT-driven logic, and user-defined types - in a single source file.
Use INPUT to read one or more values into variables, for example INPUT "Age: ", age, or LINE INPUT to read a whole line of text including spaces into a string. On XCODX the program pauses at INPUT so you can type into the live terminal, or you can paste values into the Stdin Box, and Ctrl+D closes the stream. INPUT splits on commas and parses to the variable's type, so use LINE INPUT when you want the entire line exactly as typed.
No for third-party libraries, and graphics need care. The sandbox compiles a single file with fbc and has no package manager or network, so libraries such as SDL are unavailable, and the built-in SCREEN graphics need a display the cloud runner does not provide. Console features - PRINT, INPUT, string and math functions, arrays, and user-defined types - work, so keep programs text-based here.
It is compatible, not identical. FreeBASIC's default dialect modernizes the language, and it also has a QuickBASIC-compatible mode you can request by putting #lang "qb" at the top of the file, which compiles many old QBasic and QuickBASIC programs with few changes. Unlike those, FreeBASIC compiles to a native executable instead of running inside an interpreter, so the old code becomes a standalone program.
No. They share the BASIC keyword family but are separate projects: FreeBASIC is an open-source native compiler descended from QuickBASIC, while Visual Basic and VB.NET are Microsoft languages that run on the .NET runtime. Code does not port between them directly. On XCODX FreeBASIC is the freebasic option and VB.NET is a different one.
It compiles. fbc turns your source into native machine code and links a standalone executable, which the sandbox then runs, so there is a brief compile step before output appears. This is why FreeBASIC programs run quickly compared with interpreted BASIC dialects. You only see the program's output here, but under the hood a real binary was built and executed.
By default FreeBASIC lets you use variables without declaring them, but it is good practice to declare them with Dim, for example Dim As Integer count. Adding Option Explicit near the top forces every variable to be declared, which catches typos. Types like Integer, Double, and String make the intent clear and avoid surprises.
main.basvbINPUT' FreeBASIC Program
Print "Hello from FreeBASIC!"
Print "Welcome to XCODX Online Compiler!"
Dim As Integer i, total
total = 0
For i = 1 To 5
total += i
Next
Print "Sum of 1 to 5 = "; total