.TEX file extension

To open .TEX files on Windows, to view or edit: Right-click the .tex file → Open with → choose a text editor (any plain-text editor works).

To open a .tex file, use a text editor (it is plain text) or a TeX system to compile it. On desktop operating systems, you can edit it directly; on mobile, you’ll usually view/edit the text but compile on a desktop or server.

Last updated: June 11, 2026 · Reviewed by Julian Stricker

What “reviewed” means on this page
  • Format fit: whether the “what is this file?” description matches common real-world use of the extension, including category, typical MIME types, and aliases.
  • Opening paths: whether Windows / macOS / Linux steps read plausibly for current OS dialogs and default apps; we remove fantasy menus and unsafe shortcuts.
  • Security framing: whether risk notes match the extension class (for example executables vs plain data) and whether affiliate wording does not contradict the security section.
  • Sources and further reading: whether external links point to vendors, standards bodies, or other primary references where possible; we avoid inventing details we cannot ground.
  • Limits: this is clarity and safety-messaging QA, not a guarantee that every statement is exhaustive or that every binary you download is harmless.

Full methodology in the Imprint The Imprint also states where AI is used and what that does—and does not—replace.

Open on your device

Choose your operating system for a dedicated step-by-step opening guide.

How to open .TEX files

Use these platform-specific instructions to open .TEX files safely.

Windows

  1. To view or edit: Right-click the .tex file → Open with → choose a text editor (any plain-text editor works).
  2. To typeset/compile: Install a TeX distribution and run TeX on the file (compiling produces formatted output; the exact output depends on your toolchain).
  3. If double-click opens the wrong app: Right-click → Open with → Choose another app, and set it as default for .tex.
Full Windows guide

Mac

  1. To view or edit: Control-click the .tex file → Open With → choose a text editor (it is plain text).
  2. To typeset/compile: Use a TeX distribution and run TeX on the .tex source to generate the formatted result.
  3. If you need a quick read-only look: Open it in any text viewer to inspect the source (you will still need TeX to produce final typeset output).
Full Mac guide

Linux

  1. To view or edit: Open the .tex file with a text editor from your file manager (it is plain text).
  2. To typeset/compile: Run TeX from a terminal (for example, using the tex command provided by TeX Live packages).
  3. If the file type is not recognized: Update shared MIME info / file associations on your desktop environment so .tex maps correctly (many systems use shared-mime-info mappings).
Full Linux guide

iOS

  1. Open the file in the Files app with a text-capable editor/viewer to read or edit the source; for producing final typeset output, transfer the .tex file to a desktop TeX environment.
Full iOS guide

Android

  1. Open the file with a text editor app to view/edit the source; to compile into a formatted document, move the .tex file to a desktop TeX setup or a trusted remote build environment.
Full Android guide

Security notes

  • .tex files are plain text, but compiling them invokes a TeX engine that parses and processes commands; only compile TeX sources you trust.
  • Be cautious with TeX projects from unknown sources: they may rely on additional included files; review the source before compiling to understand what it is doing.
  • If a .tex file arrives with many companion files, verify you received exactly what you expected (a TeX project) and not a misleading bundle with unrelated executables.

If you did not expect this file

This extension is usually plain data, text, or structured content—not a program by itself. The practical risk is social engineering (a scam attachment or misleading filename). For trusted senders you rarely need heavy-handed antivirus wording; use these tools when you want an extra check on unexpected downloads.

We may earn a commission when you use affiliate links. This supports our free file extension guides.

Can't open this file?

These are the most common causes and fixes when .TEX files fail to open.

Common reasons

  • Double-clicking opens a blank page or the wrong program
  • TeX cannot find the input file when compiling
  • Output is missing content because referenced files are not included
  • Web server or email labels the file with an unexpected MIME type

Fix steps

  1. Use “Open with” and choose a plain text editor.
  2. Change the default app association for .tex to a text editor.
  3. If you expected a formatted document, compile the .tex source with a TeX distribution instead of trying to “open” it like a PDF.

What is a .TEX file?

.tex is the conventional file extension for TeX input files—the source text that the TeX program reads to typeset a document. TeX commonly assumes “.tex” as the default extension when none is provided, reflecting its role as the standard input format. The content is plain text containing TeX commands and document text.

Background

TeX is a typesetting system created for producing high-quality documents, especially those with complex mathematical notation. A .tex file is not a “finished document” in the way a .docx or .pdf is; it is the source that TeX processes to generate formatted output.

In many workflows, you write and maintain .tex files in a text editor, then run a TeX engine (for example, the tex command in a TeX distribution) to compile them. The TeX program documentation and manpages both reflect that TeX expects input with the .tex extension by default.

On Linux and other Unix-like systems, desktop environments often recognize .tex via MIME type mappings from the shared-mime-info database and related system mappings (such as /etc/mime.types). This affects which editor is offered as a default when you double-click the file, and how the file may be served by web servers.

Common MIME types: text/x-tex

Further reading

Authoritative resources for more details on the .TEX format.

Common .TEX issues

Double-clicking opens a blank page or the wrong program

.tex is plain text; if your system associates it with an unsuitable app, it may appear blank or open in a viewer that does not display text properly.

  1. Use “Open with” and choose a plain text editor.
  2. Change the default app association for .tex to a text editor.
  3. If you expected a formatted document, compile the .tex source with a TeX distribution instead of trying to “open” it like a PDF.

TeX cannot find the input file when compiling

TeX often appends “.tex” if you omit the extension; compilation can fail if you run it from the wrong directory or the file name/path is incorrect.

  1. Run the compile command from the folder that contains the .tex file, or provide the full path.
  2. Verify the file name exactly matches (including case on case-sensitive systems).
  3. If you omitted the extension, try specifying the full filename including .tex.

Output is missing content because referenced files are not included

.tex sources often reference additional files (for example, other input files). If those files are not present, compilation may fail or produce incomplete output.

  1. Ensure any referenced companion files are in the expected folders alongside the .tex file.
  2. If you received the file by email or download, ask the sender for the complete project folder rather than only a single .tex file.

Web server or email labels the file with an unexpected MIME type

Many systems use non-IANA “x-” MIME types or local mappings (for example via /etc/mime.types or shared-mime-info). This can affect downloads, previews, and default apps.

  1. If you administer the system, check its MIME mappings (for example /etc/mime.types) and desktop MIME database behavior.
  2. Treat the file as plain text for viewing/editing, regardless of how it is labeled.

FAQ

Is a .tex file the same as a PDF?

No. A .tex file is the source code for TeX typesetting. You typically compile it with TeX to produce formatted output (often DVI or PDF, depending on your toolchain).

Can I open a .tex file in any text editor?

Yes. .tex is plain text, so any text editor can open it. Specialized TeX editors can provide helpful features, but they are not required just to read or edit the file.

What MIME type should .tex use?

Many systems use the non-IANA vendor type text/x-tex via local mappings and shared MIME databases. IANA’s registry is the authoritative source for officially registered media types.

Will renaming a .tex file to .txt or .pdf convert it?

No. Renaming only changes the extension. To get a formatted document, compile the .tex source using a TeX system.

Similar file extensions

Compare related formats in the same category to find the right tool faster.