There are eight basic types in Lua: nil, boolean, number, string, function, userdata, thread, and table. Nil is the type of the value nil, whose main property is to be different from any other value; usually it represents the absence of a useful value. Boolean is the type of the values false and true. In Lua, both nil and false make a condition false; any other value makes it true. Number represents real (double-precision floating-point) numbers. (It is easy to build Lua interpreters that use other internal representations for numbers, such as single-precision float or long integers.) String represents arrays of characters. Lua is 8-bit clean: Strings may contain any 8-bit character, including embedded zeros () (see ).

    Functions are first-class values in Lua. That means that functions can be stored in variables, passed as arguments to other functions, and returned as results. Lua can call (and manipulate) functions written in Lua and functions written in C (see 2.5.7).

    The type thread represents independent threads of execution and it is used to implement coroutines.

    The type table implements associative arrays, that is, arrays that can be indexed not only with numbers, but with any value (except nil). Moreover, tables can be heterogeneous, that is, they can contain values of all types (except nil). Tables are the sole data structuring mechanism in Lua; they may be used to represent ordinary arrays, symbol tables, sets, records, graphs, trees, etc. To represent records, Lua uses the field name as an index. The language supports this representation by providing as syntactic sugar for . There are several convenient ways to create tables in Lua (see ).

    Tables, functions, and userdata values are objects: variables do not actually contain these values, only references to them. Assignment, parameter passing, and function returns always manipulate references to such values; these operations do not imply any kind of copy.

    The library function returns a string describing the type of a given value (see 5.1).