ā¹ļø Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://onecompiler.com/lua |
| Last Crawled | 2026-04-17 13:30:42 (5 hours ago) |
| First Indexed | 2019-04-16 22:20:57 (7 years ago) |
| HTTP Status Code | 200 |
| Meta Title | Lua Online Compiler & Interpreter |
| Meta Description | OneCompiler's Lua online editor helps you to write, compile, debug and run Lua code online. |
| Meta Canonical | null |
| Boilerpipe Text | Write, Run & Share Lua code online using OneCompiler's Lua online compiler for free. It's one of the robust, feature-rich online compilers for Lua language, running on Lua 5.4. Getting started with the OneCompiler's Lua editor is easy and fast. The editor shows sample boilerplate code when you choose language as Lua and start coding.
Taking inputs (stdin)
OneCompiler's Lua online editor supports stdin and users can give inputs to programs using the STDIN textbox under the I/O tab. Following is a sample Lua program which takes name as input and prints hello message with your name.
name = io.read(
"*a"
)
print (
"Hello "
, name)
About Lua
Lua is a light weight embeddable scripting language which is built on top of C. It is used in almost all kind of applications like games, web applications, mobile applications, image processing etc. It's a very powerful, fast, easy to learn, open-source scripting language.
Syntax help
Variables
By default all the variables declared are global variables
If the variables are explicitly mentioned as local then they are local variables.
Lua is a dynamically typed language and hence only the values will have types not the variables.
Examples
-- global variables
a =
10
-- local variables
local x =
30
Value Type
Description
number
Represents numbers
string
Represents text
nil
Differentiates values whether it has data or not
boolean
Value can be either true or false
function
Represents a sub-routine
userdata
Represents arbitary C data
thread
Represents independent threads of execution.
table
Can hold any value except nil
Loops
1. While:
While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.
while
(condition)
do
--code
end
2. Repeat-Until:
Repeat-Until is also used to iterate a set of statements based on a condition. It is very similar to Do-While, it is mostly used when you need to execute the statements atleast once.
repeat
--
code
until
( condition )
3. For:
For loop is used to iterate a set of statements based on a condition.
for
init,max/min value, increment
do
--code
end
Functions
Function is a sub-routine which contains set of statements. Usually functions are written when multiple calls are required to same set of statements which increase re-usuability and modularity.
optional_function_scope function
function_name
( argument1, argument2, argument3........, argumentn)
--code
return
params with comma seperated
end |
| Markdown | [](https://onecompiler.com/)
[Pricing](https://onecompiler.com/pricing)
Learn
Code
Deploy
More
Login
Main.lua
# Lua Hello World\!
AI
LUA
RUN
AI
LUA
RUN
Main.lua
1
print ("Hello, World!")
××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
STDIN
Output:
```
Click on RUN button to see the output
```
# Lua online compiler
Write, Run & Share Lua code online using OneCompiler's Lua online compiler for free. It's one of the robust, feature-rich online compilers for Lua language, running on Lua 5.4. Getting started with the OneCompiler's Lua editor is easy and fast. The editor shows sample boilerplate code when you choose language as Lua and start coding.
# Taking inputs (stdin)
OneCompiler's Lua online editor supports stdin and users can give inputs to programs using the STDIN textbox under the I/O tab. Following is a sample Lua program which takes name as input and prints hello message with your name.
```
name = io.read("*a")
print ("Hello ", name)
```
# About Lua
Lua is a light weight embeddable scripting language which is built on top of C. It is used in almost all kind of applications like games, web applications, mobile applications, image processing etc. It's a very powerful, fast, easy to learn, open-source scripting language.
# Syntax help
## Variables
- By default all the variables declared are global variables
- If the variables are explicitly mentioned as local then they are local variables.
- Lua is a dynamically typed language and hence only the values will have types not the variables.
### Examples
```
-- global variables
a = 10
-- local variables
local x = 30
```
| Value Type | Description |
|---|---|
| number | Represents numbers |
| string | Represents text |
| nil | Differentiates values whether it has data or not |
| boolean | Value can be either true or false |
| function | Represents a sub-routine |
| userdata | Represents arbitary C data |
| thread | Represents independent threads of execution. |
| table | Can hold any value except nil |
## Loops
### 1\. While:
While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.
```
while(condition)
do
--code
end
```
### 2\. Repeat-Until:
Repeat-Until is also used to iterate a set of statements based on a condition. It is very similar to Do-While, it is mostly used when you need to execute the statements atleast once.
```
repeat
--code
until( condition )
```
### 3\. For:
For loop is used to iterate a set of statements based on a condition.
```
for init,max/min value, increment
do
--code
end
```
## Functions
Function is a sub-routine which contains set of statements. Usually functions are written when multiple calls are required to same set of statements which increase re-usuability and modularity.
```
optional_function_scope function function_name( argument1, argument2, argument3........, argumentn)
--code
return params with comma seperated
end
```
###### OneCompiler.com
[About](https://onecompiler.com/about)[Use Cases](https://onecompiler.com/customer-use-cases)[Contact](https://onecompiler.com/contact)
[Users](https://onecompiler.com/users)[Status](https://status.onecompiler.com/)[Pricing](https://onecompiler.com/pricing)[Refund Policy](https://onecompiler.com/about#refund-policy)
[GitHub](https://github.com/onecompiler)[LinkedIn](https://www.linkedin.com/company/onecompiler)[Facebook](https://www.facebook.com/onecompiler)[Instagram](https://www.instagram.com/onecompiler)[Twitter](https://twitter.com/OneCompilerHQ)
###### Languages
[Python](https://onecompiler.com/python)[Java](https://onecompiler.com/java)[C](https://onecompiler.com/c)[C++](https://onecompiler.com/cpp)[JavaScript](https://onecompiler.com/javascript)[Lua](https://onecompiler.com/lua)[PHP](https://onecompiler.com/php)[NodeJS](https://onecompiler.com/nodejs)[C\#](https://onecompiler.com/csharp)[Assembly](https://onecompiler.com/assembly)[Bash](https://onecompiler.com/bash)[Visual Basic (VB.NET)](https://onecompiler.com/vb)[Kotlin](https://onecompiler.com/kotlin)[Pascal](https://onecompiler.com/pascal)[Ruby](https://onecompiler.com/ruby)[Groovy](https://onecompiler.com/groovy)[Scala](https://onecompiler.com/scala)[Prolog](https://onecompiler.com/prolog)[Tcl](https://onecompiler.com/tcl)[TypeScript](https://onecompiler.com/typescript)[JShell](https://onecompiler.com/jshell)[Haskell](https://onecompiler.com/haskell)[Ada](https://onecompiler.com/ada)[CommonLisp](https://onecompiler.com/commonlisp)[D](https://onecompiler.com/d)[Elixir](https://onecompiler.com/elixir)[Erlang](https://onecompiler.com/erlang)[F\#](https://onecompiler.com/fsharp)[Fortran](https://onecompiler.com/fortran)[Python2](https://onecompiler.com/python2)[Perl](https://onecompiler.com/perl)[Go](https://onecompiler.com/go)[R](https://onecompiler.com/r)[Racket](https://onecompiler.com/racket)[OCaml](https://onecompiler.com/ocaml)[Basic](https://onecompiler.com/basic)[HTML](https://onecompiler.com/html)[React](https://onecompiler.com/react)[Vue](https://onecompiler.com/vue)[Angular](https://onecompiler.com/angular)[Materialize](https://onecompiler.com/materialize)[Bootstrap](https://onecompiler.com/bootstrap)[Tailwind CSS](https://onecompiler.com/tailwindcss)[HTMX](https://onecompiler.com/htmx)[Alpine.js](https://onecompiler.com/alpinejs)[Chart.js](https://onecompiler.com/chartjs)[D3.js](https://onecompiler.com/d3js)[JQuery](https://onecompiler.com/jquery)[Foundation](https://onecompiler.com/foundation)[Bulma](https://onecompiler.com/bulma)[Uikit](https://onecompiler.com/uikit)[Semantic UI](https://onecompiler.com/semanticUI)[Skeleton](https://onecompiler.com/skeleton)[Milligram](https://onecompiler.com/milligram)[PaperCSS](https://onecompiler.com/paperCss)[BackboneJS](https://onecompiler.com/backbonejs)[sh (Shell Script)](https://onecompiler.com/sh)[Clojure](https://onecompiler.com/clojure)[Cobol](https://onecompiler.com/cobol)[Rust](https://onecompiler.com/rust)[Swift](https://onecompiler.com/swift)[Objective-C](https://onecompiler.com/objectivec)[Octave](https://onecompiler.com/octave)[Text](https://onecompiler.com/text)[BrainFK](https://onecompiler.com/brainfk)[CoffeeScript](https://onecompiler.com/coffeescript)[EJS](https://onecompiler.com/ejs)[Dart](https://onecompiler.com/dart)[Deno](https://onecompiler.com/deno)[Bun](https://onecompiler.com/bun)[Crystal](https://onecompiler.com/crystal)[Julia](https://onecompiler.com/julia)[Zig](https://onecompiler.com/zig)[AWK](https://onecompiler.com/awk)[ISPC](https://onecompiler.com/ispc)[Smalltalk](https://onecompiler.com/smalltalk)[Nim](https://onecompiler.com/nim)[Scheme](https://onecompiler.com/scheme)[J](https://onecompiler.com/j)[V](https://onecompiler.com/v)[Raku](https://onecompiler.com/raku)[Verilog](https://onecompiler.com/verilog)[Haxe](https://onecompiler.com/haxe)[Forth](https://onecompiler.com/forth)[Icon](https://onecompiler.com/icon)[Odin](https://onecompiler.com/odin)[MySQL](https://onecompiler.com/mysql)[Oracle Database](https://onecompiler.com/oracle)[PostgreSQL](https://onecompiler.com/postgresql)[MongoDB](https://onecompiler.com/mongodb)[SQLite](https://onecompiler.com/sqlite)[Redis](https://onecompiler.com/redis)[MariaDB](https://onecompiler.com/mariadb)[Oracle PL/SQL](https://onecompiler.com/plsql)[Microsoft SQL Server](https://onecompiler.com/sqlserver)[Cassandra](https://onecompiler.com/cassandra)[QuestDB](https://onecompiler.com/questdb)[DuckDB](https://onecompiler.com/duckdb)[SurrealDB](https://onecompiler.com/surrealdb)[Firebird](https://onecompiler.com/firebird)[ClickHouse](https://onecompiler.com/clickhouse)
###### More
[Studio](https://onecompiler.com/studio)[Orgs](https://onecompiler.com/orgs)[API](https://onecompiler.com/apis)[Pricing](https://onecompiler.com/apis/pricing)
[Cheatsheets](https://onecompiler.com/cheatsheets)[Tutorials](https://onecompiler.com/tutorials)[Tools](https://onecompiler.com/tools)[AI Tools](https://onecompiler.com/ai)[Stats](https://onecompiler.com/stats)
Ā© Copyright 2026 One Compiler Pvt. Ltd. \| [Privacy Policy](https://onecompiler.com/privacy-policy) \| [Terms & Conditions](https://onecompiler.com/terms-and-conditions) |
| Readable Markdown | Write, Run & Share Lua code online using OneCompiler's Lua online compiler for free. It's one of the robust, feature-rich online compilers for Lua language, running on Lua 5.4. Getting started with the OneCompiler's Lua editor is easy and fast. The editor shows sample boilerplate code when you choose language as Lua and start coding.
## Taking inputs (stdin)
OneCompiler's Lua online editor supports stdin and users can give inputs to programs using the STDIN textbox under the I/O tab. Following is a sample Lua program which takes name as input and prints hello message with your name.
```
name = io.read("*a")
print ("Hello ", name)
```
## About Lua
Lua is a light weight embeddable scripting language which is built on top of C. It is used in almost all kind of applications like games, web applications, mobile applications, image processing etc. It's a very powerful, fast, easy to learn, open-source scripting language.
## Syntax help
## Variables
- By default all the variables declared are global variables
- If the variables are explicitly mentioned as local then they are local variables.
- Lua is a dynamically typed language and hence only the values will have types not the variables.
### Examples
```
-- global variables
a = 10
-- local variables
local x = 30
```
| Value Type | Description |
|---|---|
| number | Represents numbers |
| string | Represents text |
| nil | Differentiates values whether it has data or not |
| boolean | Value can be either true or false |
| function | Represents a sub-routine |
| userdata | Represents arbitary C data |
| thread | Represents independent threads of execution. |
| table | Can hold any value except nil |
## Loops
### 1\. While:
While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.
```
while(condition)
do
--code
end
```
### 2\. Repeat-Until:
Repeat-Until is also used to iterate a set of statements based on a condition. It is very similar to Do-While, it is mostly used when you need to execute the statements atleast once.
```
repeat
--code
until( condition )
```
### 3\. For:
For loop is used to iterate a set of statements based on a condition.
```
for init,max/min value, increment
do
--code
end
```
## Functions
Function is a sub-routine which contains set of statements. Usually functions are written when multiple calls are required to same set of statements which increase re-usuability and modularity.
```
optional_function_scope function function_name( argument1, argument2, argument3........, argumentn)
--code
return params with comma seperated
end
``` |
| Shard | 139 (laksa) |
| Root Hash | 1017704921348289539 |
| Unparsed URL | com,onecompiler!/lua s443 |