[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"extension:v3:en:lua":3},{"resolvedFromAlias":4,"canonicalExt":5,"ext":5,"name":6,"category":7,"categoryName":8,"updatedAt":9,"popularity":10,"summary":11,"howToOs":12,"quickAnswer":18,"answerIntro":19,"whatIs":20,"description":21,"furtherReading":22,"openInstructions":41,"commonIssues":55,"securityNotes":74,"faq":78,"aliases":91,"mimeTypes":92,"relatedExtensions":93,"breadcrumbs":141,"categoryAnchor":151,"categoryFuturePath":152,"metaDescription":153,"availableHowToOs":154,"openOnDeviceLinks":155,"cannotOpenReasons":171,"cannotOpenFixes":172,"convertOptions":173,"securityAffiliateMessaging":174,"securityAffiliates":175},false,"lua","Lua source code (Lua script)","code","Code","2026-06-12T09:07:28.376Z",55,".lua files contain Lua source code used as scripts or modules in Lua-based applications and embedded systems. You can open them in a text editor or run them with a Lua interpreter when available.",[13,14,15,16,17],"windows","mac","linux","ios","android","To open .LUA files on Windows, to view/edit: right-click the .lua file and open it with a text/code editor (for example, Visual Studio Code or Notepad++).","To open a .lua file, use a code editor or text editor (it is plain-text Lua source code). To run it, use a Lua interpreter or the host application/game that uses Lua scripting.","A .lua file is typically a Lua “chunk” (Lua source code) that can be loaded and executed by the Lua interpreter or embedded Lua runtimes. Lua is designed to be embedded in other programs, so many apps and games use .lua files for configuration, logic, or add-ons. In Lua terminology, source code loaded for execution is treated as a chunk.","Lua is a lightweight, high-level programming language commonly used for scripting and embedding into other software. In practice, .lua files are used both as standalone scripts you run with a Lua interpreter and as modules that are loaded by another program that embeds Lua.",[23,26,29,32,35,38],{"title":24,"url":25},"Lua 5.4 Reference Manual (official language manual)","https://www.lua.org/manual/5.4/manual.html?external_link=true",{"title":27,"url":28},"Lua Reference Manuals (index, official definitions by version)","https://www.lua.org/manual/index.html",{"title":30,"url":31},"Lua (programming language) overview","https://en.wikipedia.org/wiki/Lua",{"title":33,"url":34},"LUA File - What is a .lua file and how do I open it?","https://fileinfo.com/extension/lua",{"title":36,"url":37},"IANA Media Types registry (check for official MIME types)","https://www.iana.org/assignments/media-types/",{"title":39,"url":40},"Shared MIME-info Database specification (Linux MIME detection and glob mappings)","https://apol.pages.freedesktop.org/xdg-specs/shared-mime-info-spec/shared-mime-info-spec-latest.html",{"windows":42,"macos":45,"linux":48,"ios":51,"android":53},[43,44],"To view/edit: right-click the .lua file and open it with a text/code editor (for example, Visual Studio Code or Notepad++).","To run: install a Lua interpreter and execute it from a command prompt (many environments use a command like running Lua with the script name), or run it through the specific application that uses the script.",[46,47],"To view/edit: open the .lua file in a code editor (for example, Visual Studio Code or Sublime Text).","To run: use a Lua interpreter if installed, or execute it within the app/game that the script was written for.",[49,50],"To view/edit: open the file in a text editor (for example, Vim, Emacs, or Visual Studio Code).","To run: use a Lua interpreter if installed (commonly invoked from a terminal) or the embedding application that loads the script.",[52],"iOS does not typically provide a system-wide way to run Lua scripts; open the file in a text/code editor app to view it, or transfer it to a desktop to run with Lua or the intended host app.",[54],"Android does not typically provide a standard Lua runtime for arbitrary scripts; open the file in a text/code editor app to view it, or transfer it to a desktop to run with Lua or the intended host app.",[56,62,68],{"title":57,"description":58,"steps":59},"The script won’t run (no Lua interpreter or wrong environment)",".lua files are source code; they run only in a Lua interpreter or in the specific program that embeds Lua. A script written for a particular game/tool may not run correctly in a generic Lua interpreter because it depends on the host’s APIs.",[60,61],"Check where the .lua file came from (game/mod, application plugin, standalone script) and run it in that intended host if required.","If it is meant to be a standalone Lua script, install a Lua interpreter and run it from the command line, or use a development environment configured for Lua.",{"title":63,"description":64,"steps":65},"Syntax/runtime errors when executing the file","Lua will error if the source code has syntax problems or if it calls functions/modules that are missing in your environment. Scripts distributed with applications often assume certain libraries or a specific Lua version/embedding.",[66,67],"Run the script in the same application/runtime it was written for, or ensure required modules are present.","Consult the Lua reference manual for the language rules and standard behavior when loading/executing chunks.",{"title":69,"description":70,"steps":71},"Double-click opens in the wrong app (file association)","Because .lua is plain text and used by many tools, your OS may associate it with a generic editor or an unrelated program.",[72,73],"Use “Open with…” and pick your preferred code editor, then set it as the default for .lua files.","On Linux desktops, updating MIME/association settings may help if your system does not map .lua as expected.",[75,76,77],".lua files can contain executable logic; opening in a text editor is generally safe, but running a script can execute arbitrary actions permitted by the host program or Lua environment.","Be especially cautious with .lua files used by games/mods or plugin systems: the embedding application may expose powerful APIs (file access, networking, etc.), so only run scripts from sources you trust.","A script may be safe in one context but dangerous in another: the same .lua file can behave differently depending on what libraries and host APIs are available in the environment loading it.",[79,82,85,88],{"question":80,"answer":81},"Is a .lua file just text?","Typically yes. A .lua file normally contains plain-text Lua source code that you can view and edit in a text/code editor.",{"question":83,"answer":84},"How do I run a .lua file?","Run it with a Lua interpreter, or load it in the application/game that uses Lua scripting. Many .lua files are meant for a specific host environment rather than standalone execution.",{"question":86,"answer":87},"Does .lua have an official IANA MIME type?","This depends on what is registered with IANA’s media type registry; consult the IANA Media Types registry to verify whether an official standard media type exists for Lua scripts.",{"question":89,"answer":90},"Why does my .lua script work on one machine but not another?","Lua scripts can depend on the Lua version, installed modules, or APIs provided by the embedding program. Differences in those components commonly cause missing-module or runtime errors.",[],[],[94,100,105,111,117,123,129,135],{"ext":95,"name":96,"category":7,"categoryName":8,"popularity":97,"summary":98,"howToOs":99},"php","PHP script (PHP source code)",85,".php files typically contain PHP source code used on web servers to generate dynamic web pages and API responses. You can open them in a code editor, but they are usually executed by a web server (often via PHP-FPM) rather than “run” like a normal desktop app.",[13,14,15,16,17],{"ext":101,"name":102,"category":7,"categoryName":8,"popularity":97,"summary":103,"howToOs":104},"sql","SQL script (Structured Query Language)",".sql files contain SQL statements (queries, schema definitions, and data changes) that can be run by a database tool or opened as plain text for review and editing.",[13,14,15,16,17],{"ext":106,"name":107,"category":7,"categoryName":8,"popularity":108,"summary":109,"howToOs":110},"cs","C# source code file",80,".cs files contain C# source code used to build .NET applications and libraries. They are plain-text files typically edited in code editors and IDEs such as Visual Studio Code with C# tooling.",[13,14,15,16,17],{"ext":112,"name":113,"category":7,"categoryName":8,"popularity":114,"summary":115,"howToOs":116},"go","Go source file",78,".go files contain source code written in the Go (Golang) programming language. You can open them in code editors (for reading/editing) or build/run them with the Go toolchain.",[13,14,15,16,17],{"ext":118,"name":119,"category":7,"categoryName":8,"popularity":120,"summary":121,"howToOs":122},"tsx","TypeScript JSX (TSX) source file",75,".tsx is a TypeScript source code file that contains JSX syntax, commonly used with React-style UI components. You open it in a code editor (for viewing/editing) and build it with TypeScript tooling (for running in apps).",[13,14,15,16,17],{"ext":124,"name":125,"category":7,"categoryName":8,"popularity":126,"summary":127,"howToOs":128},"kt","Kotlin source file",72,".kt files contain Kotlin source code used to build Kotlin applications (including Android apps) and libraries. You typically open them in a code editor or IDE such as IntelliJ IDEA or Android Studio.",[13,14,15,16,17],{"ext":130,"name":131,"category":7,"categoryName":8,"popularity":132,"summary":133,"howToOs":134},"swift","Swift Source Code",70,".swift is a Swift programming language source file used to write apps and other software. You open it in code editors and IDEs such as Xcode or other text/code editors.",[13,14,15,16,17],{"ext":136,"name":137,"category":7,"categoryName":8,"popularity":138,"summary":139,"howToOs":140},"dart","Dart source code",65,".dart files contain source code written in the Dart programming language. You open them in a code editor/IDE or work with them using the Dart SDK tools.",[13,14,15,16,17],[142,145,148],{"label":143,"to":144},"Home","/",{"label":146,"to":147},"File Extension Index","/file-extension",{"label":149,"to":150},".LUA","/file-extension/lua","category-code","/category/code","Learn what .LUA files are, how to open them on every platform, common fixes, and security best practices.",[13,14,15,16,17],[156,159,162,165,168],{"os":13,"label":157,"to":158},"Open .LUA on Windows","/how-to/open-lua-on-windows",{"os":14,"label":160,"to":161},"Open .LUA on Mac","/how-to/open-lua-on-mac",{"os":15,"label":163,"to":164},"Open .LUA on Linux","/how-to/open-lua-on-linux",{"os":16,"label":166,"to":167},"Open .LUA on iOS","/how-to/open-lua-on-ios",{"os":17,"label":169,"to":170},"Open .LUA on Android","/how-to/open-lua-on-android",[57,63,69],[60,61],[],"code_runtime",[176,180],{"name":177,"description":178,"affiliateUrl":179},"Avast","Avast offers free and premium antivirus software that protects against viruses, malware, ransomware, and phishing. Scan files before opening them to ensure safety.","https://www.avast.com/lp-aff-consumer-store?expid=inf601",{"name":181,"description":182,"affiliateUrl":183},"Norton","Norton 360 delivers comprehensive antivirus protection, VPN, and identity theft monitoring. Scan files for threats before opening to keep your device secure.","http://buy.norton.com/aff_home?utm_campaign=en-ww_nor_n36_aff_nas_nau_nah_cj_nad_low:_sec_nat_mktc_norton_360"]