Free tools Windows power users keep installed
One-click scans. No signup required.
Use Tkinter’s Text widget when your Python GUI needs an editable, multiline text area. Create it with a parent window, place it with a geometry manager, and use its insert, get, and delete methods to work with text.
Create and display a Text widget
This example creates a window with a word-wrapped text area and a vertical scrollbar:
import tkinter as tk
root = tk.Tk()
root.title("Text widget example")
text = tk.Text(root, width=50, height=10, wrap="word")
text.pack(side="left", fill="both", expand=True)
scrollbar = tk.Scrollbar(root, orient="vertical", command=text.yview)
scrollbar.pack(side="right", fill="y")
text.configure(yscrollcommand=scrollbar.set)
text.insert("1.0", "Write or display multiple lines here.")
root.mainloop()
The Text constructor takes a parent widget—in this case, root—and accepts configuration options such as width, height, and wrapping behavior. Call a geometry manager such as pack, grid, or place to show it in the window. Here, pack lets the text area expand with the window.
The scrollbar connection works in both directions: yscrollcommand=scrollbar.set lets the Text widget update the scrollbar’s position, while command=text.yview sends scrollbar actions to the widget.
Recommended Free Tools
#1 Best Overall
Add, retrieve, and remove text
Use insert to add text, get to read a range, and delete to remove one. Text methods use indices to identify positions:
text.insert("1.0", "First linenSecond line")
contents = text.get("1.0", "end-1c")
text.delete("1.0", "end")
"1.0" means line 1, character position 0. Line numbers start at 1, and character positions within a line start at 0. The "end" index is after the widget’s final newline, so get("1.0", "end-1c") omits that trailing newline when reading the entered content. Use delete with a start and end index to clear or remove a range.
Rank #2
Choose wrapping and scrolling behavior
The example sets wrap="word", so long lines wrap at word boundaries. If the content should remain on one visual line, choose the wrapping behavior deliberately and provide horizontal scrolling if users need to reach text beyond the visible width. Add a vertical scrollbar when users need to move through longer content.
Use indices, tags, and marks
Indices can refer to a line and character, the end of the text, a mark, the first or last character carrying a tag, an embedded image or window, or a pixel position such as @x,y. Modifiers can move an index relative to its base, including by characters or lines.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Tags apply to ranges of characters and can be configured to style or annotate those ranges. Marks name positions in the text; mark gravity controls which side of newly inserted text a mark stays on. The widget can also embed images and other widgets, and its API supports undo and redo as well as peer Text widgets that share underlying text data.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.When to use Text
Use Text for multiline content that users need to edit or read in a larger area. For a single-line input, choose an entry-style widget instead. The Python documentation describes these capabilities but does not establish a performance comparison between widget types.
See the Python 3.14 tkinter documentation for the complete Text widget API and configuration options.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

