Skip to content

.TK file extension

To open .TK files on Windows, install Tcl/Tk so the Wish interpreter (wish) is available.

To open a .tk file, run it with the Tcl/Tk Wish interpreter (wish) or open it in a text editor to view the script. Don’t rename the extension to “convert” it—install Tcl/Tk and use wish (or an editor) instead.

Last updated: June 10, 2026

Open on your device

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

How to open .TK files

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

Windows

  1. Install Tcl/Tk so the Wish interpreter (wish) is available.
  2. Right-click the .tk file → Open with → choose Wish (or run from a terminal as: wish yourfile.tk).
  3. If you only need to read it, open it with a text editor to view the Tcl/Tk script.
Full Windows guide

Mac

  1. Install Tcl/Tk so the Wish interpreter (wish) is available.
  2. Run it from Terminal with: wish /path/to/yourfile.tk (or open it in a text editor to inspect the script).
Full Mac guide

Linux

  1. Install Tcl/Tk (provides wish).
  2. Run the script from a terminal: wish yourfile.tk (or right-click → Open With → choose an installed Wish/Tcl/Tk runner if your desktop environment offers one).
  3. To inspect without executing, open the file in a text editor.
Full Linux guide

iOS

  1. iOS does not commonly support running Tcl/Tk Wish scripts; open the .tk file in a text editor app to view the text, or transfer it to a desktop (Windows/macOS/Linux) with Tcl/Tk installed to run it.
Full iOS guide

Android

  1. Android does not commonly include Tcl/Tk Wish; use a text editor app to view the script, or move the file to a desktop system with Tcl/Tk installed to execute it.
Full Android guide

Security notes

  • .tk files are scripts: running them with wish executes code. If you don’t trust the source, open in a text editor first and review the commands before executing.
  • Be cautious with .tk scripts that interact with the filesystem or run external commands; treat them like other executable scripts (e.g., .sh, .py).
  • If you obtained the .tk file from the internet, prefer running it in a controlled environment (such as a non-privileged user account) until you understand its behavior.

Can't open this file?

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

Common reasons

  • Double-clicking opens the file as text (or in the wrong app)
  • Error: 'wish' not found / Tcl/Tk not installed
  • Script runs but shows errors or no window appears
  • You received a .tk file but expected a 'document'

Fix steps

  1. Install Tcl/Tk so wish is available on your system.
  2. Open the file explicitly with wish (or run: wish yourfile.tk).
  3. Optionally set file association so .tk files open with Wish by default.

Recover a deleted or lost .TK file

If the file was deleted by mistake or the drive was formatted, data recovery software may be able to get it back. Stop writing to that drive right away, because new data can overwrite what you want to recover.

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

What is a .TK file?

A .tk file is usually a plain-text script containing Tcl commands intended for the Tk GUI toolkit. It is commonly executed by the Wish application, which reads Tcl/Tk commands from a file and runs the program. Because it is a script, opening it may either display text (in an editor) or execute code (when launched with wish).

Background

In practice, “.tk” most commonly refers to Tcl/Tk scripts associated with the Tk toolkit, where the file contains Tcl code that creates windows, dialogs, and other user interface elements. Many users encounter .tk files as examples, utility scripts, or small GUI tools written in Tcl/Tk.

Tcl/Tk distributions typically include key executables such as tclsh (Tcl shell) and wish (Tk application shell). For GUI-oriented scripts, wish is the common way to run .tk files because it initializes Tk and executes the script.

Because .tk files are plain text, you can safely inspect them in a text editor before running them. However, when executed they can perform actions allowed by the Tcl interpreter (e.g., file operations or launching external commands), so treat unknown .tk scripts similarly to other runnable scripts.

Common MIME types: text/x-tcl

Further reading

Authoritative resources for more details on the .TK format.

Common .TK issues

Double-clicking opens the file as text (or in the wrong app)

The OS may not know that .tk should be handled by the Wish interpreter, so it opens in a generic text editor or another associated application.

  1. Install Tcl/Tk so wish is available on your system.
  2. Open the file explicitly with wish (or run: wish yourfile.tk).
  3. Optionally set file association so .tk files open with Wish by default.

Error: 'wish' not found / Tcl/Tk not installed

The Wish interpreter is not installed or not on your PATH, so the script cannot be executed.

  1. Install a Tcl/Tk distribution that includes wish.
  2. Try launching wish directly (by full path) or adjust PATH so the command is recognized.
  3. Verify you are using wish (for Tk GUI scripts), not only tclsh.

Script runs but shows errors or no window appears

The script may rely on Tk features, external packages, or assumptions about the environment that aren’t present on your system.

  1. Run from a terminal (wish yourfile.tk) to see the error messages.
  2. Check that you are using wish (Tk) rather than a non-GUI Tcl shell.
  3. Confirm any required Tcl/Tk packages or resources referenced by the script are available.

You received a .tk file but expected a 'document'

.tk is commonly a runnable Tcl/Tk script, not a standard word-processing document; it may contain code rather than formatted content.

  1. Open the file in a text editor first to confirm it is a Tcl/Tk script.
  2. If you intended to read content rather than run code, ask the sender for a PDF/Word/LibreOffice export instead.
  3. Only execute the script with wish if you trust the source and understand what it does.

FAQ

Is a .tk file a document or a script?

Most commonly, .tk is a Tcl/Tk script (plain text) intended to be executed with the Wish interpreter to run a Tk-based GUI program.

How do I run a .tk file?

Install Tcl/Tk and execute it with Wish, for example: wish yourfile.tk. You can also open it in a text editor to read the script without running it.

Can I convert a .tk file by renaming it to another extension?

No. Renaming doesn’t change the file contents. A .tk file is typically Tcl/Tk code; if you need a different format, you’d need to export or rewrite content using appropriate tools.

What MIME type is associated with .tk?

It is commonly associated with text/x-tcl in some contexts, but you should not assume it is an officially registered IANA media type; MIME handling can vary by system and configuration.

Similar file extensions

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

Did this guide help?