.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 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 .TK files
Use these platform-specific instructions to open .TK files safely.
Windows
- Install Tcl/Tk so the Wish interpreter (wish) is available.
- Right-click the .tk file → Open with → choose Wish (or run from a terminal as: wish yourfile.tk).
- If you only need to read it, open it with a text editor to view the Tcl/Tk script.
Mac
- Install Tcl/Tk so the Wish interpreter (wish) is available.
- Run it from Terminal with: wish /path/to/yourfile.tk (or open it in a text editor to inspect the script).
Linux
- Install Tcl/Tk (provides wish).
- 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).
- To inspect without executing, open the file in a text editor.
iOS
- 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.
Android
- 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.
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.
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.
Avast offers free and premium antivirus software that protects against viruses, malware, ransomware, and phishing. Scan files before opening them to ensure safety.
NortonNorton 360 delivers comprehensive antivirus protection, VPN, and identity theft monitoring. Scan files for threats before opening to keep your device secure.
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 .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
- Install Tcl/Tk so wish is available on your system.
- Open the file explicitly with wish (or run: wish yourfile.tk).
- Optionally set file association so .tk files open with Wish by default.
OS-specific troubleshooting
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.
- Install Tcl/Tk so wish is available on your system.
- Open the file explicitly with wish (or run: wish yourfile.tk).
- 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.
- Install a Tcl/Tk distribution that includes wish.
- Try launching wish directly (by full path) or adjust PATH so the command is recognized.
- 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.
- Run from a terminal (wish yourfile.tk) to see the error messages.
- Check that you are using wish (Tk) rather than a non-GUI Tcl shell.
- 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.
- Open the file in a text editor first to confirm it is a Tcl/Tk script.
- If you intended to read content rather than run code, ask the sender for a PDF/Word/LibreOffice export instead.
- 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.
- .pdf - Portable Document Format
- .docx - Microsoft Word Open XML Document
- .xlsx - Microsoft Excel Open XML Spreadsheet
- .log - Plain-text Log File
- .pptx - Microsoft PowerPoint Open XML Presentation
- .txt - Plain Text File
- .xlsm - Excel Macro-Enabled Workbook (Office Open XML)
- .ppsx - PowerPoint Show (Office Open XML Slideshow)