You can use .place() for your label since your frame and your label have different parents. In place() you can use anchor="center" specify the startingpoint of your "anchor" with: x and y. Here is a working example:

app = Tk()
f = Frame(app,bg="yellow",width=50,height=50)
f.grid(row=0,column=0,sticky="NW")
f.grid_propagate(0)
f.update()
l = Label(f,text="123",bg="yellow")
l.place(x=25, y=25, anchor="center")
app.mainloop()
Answer from VRage on Stack Overflow
🌐
Educative
educative.io › answers › how-to-center-the-tkinter-label
How to center the Tkinter label
# Import the Tkinter library from tkinter import * # Create an instance of Tkinter window window = Tk() # Set the size of the window window.geometry("300x300") # Create a label widget label = Label(window, text = "Hello from Educative !!!") # Center the label widget label.place(relx = 0.5, rely = 0.5, anchor = CENTER) window.mainloop()
Discussions

Tkinter: How can I align the text inside a label widget?
You are probably looking for the justify option: label = tk.Label(root, text="Line 1\nSecond line", anchor="w", justify="left") label.pack() More on reddit.com
🌐 r/learnpython
3
6
March 12, 2023
How to center a Label in a Full Screen Root (tkinter, python 3)

In a line like

LabelTitle.place(x=x, y=y, anchor="center")

the anchor means to place the center of the label and the coordinates given by x and y.

Anyway, the thing is that Tk doesn't know how big the window is going to be until the main loop runs, so unless there's a flag to tell it to put the label there at that time (and there may be, I don't use Tk very often), you can't just set the position beforehand. I would do something like this:

def position_label(*args):
    LabelTitle.place(x=root.winfo_width() // 2, y=root.winfo_height() // 2, anchor='center')
root.bind("<FocusIn>", position_label)

So the root window gets focus after its geometry has been asserted, so we hook in a callback (position_label) to position the label at that time.

More on reddit.com
🌐 r/learnpython
2
1
January 26, 2020
[tkinter] How do I vertically center text to window in GUI?
Hello, I’m new to using tkinter and I am attempting to center the text in the GUI to always be vertically center of the window. Currently the text is center to the left of the canvas. I cant tell whether its the frame or label that needs the code change but what I’ve tried so far has not worked. More on discuss.python.org
🌐 discuss.python.org
12
0
November 14, 2024
python - Tkinter center Label in the GUI - Stack Overflow
Above is my Code for a Tkinter GUI but I want the have the label at the center of the root/window how do I do that? More on stackoverflow.com
🌐 stackoverflow.com
December 27, 2021
Top answer
1 of 5
20

The problem is that you are reading the documentation for the tkinter label but you are using a ttk label. This is why you should not use wildcard imports -- when two modules export objects with the same name (eg: tkinter.Label and ttk.Label) it becomes difficult to know which one is being used in your code. The default for a ttk label is to be aligned left, but the tkinter label is aligned center, and the order of your imports means that you're using a ttk Label.

The quick fix for your example is to explicitly set the anchor option for the ttk label (eg: label.configure(anchor="center")).

You should also fix your imports so that this problem doesn't happen to you again. Instead of doing a wildcard import (eg: from tkinter import *) you should explicitly import the module as a unit, optionally with a shorter name. Once you do that, you need to prefix your widgets with the name of the module.

For example, given these import statements:

import tkinter as tk
from tkinter import ttk

... you would then create a ttk label with ttk.Label(...), and a tkinter label with tk.Label(...) which makes your code much easier to understand, and it removes all ambiguity.

2 of 5
5

This is a textbook example of namespace clustering. You're clustering python's namespace, with the lines:

from tkinter import *
from tkinter.ttk import *

this means if there's a tkinter.ttk class that has the same name that of tkinter class, ttk one will be used, such as Button and Label. And apparently ttk not necessarily have the tkinter.Label's justify option. A simple position swap is sufficed to demonstrate the difference swap the imports to:

from tkinter.ttk import *
from tkinter import *

Instead and see what happens.


See below example with center justified text where no namespaces are clustered, using tkinter.Label as label:

import tkinter as tk
import tkinter.ttk as ttk

root = tk.Tk()

label = tk.Label(root, text="Test Callback")
btn = tk.Button(root, text="Text so long that root has to resize.")
btn.pack()
label.pack(fill='both', expand=True)

root.mainloop()

See below example center justified text where no namespaces are clustered, using tkinter.ttk.Label as label:

import tkinter as tk
import tkinter.ttk as ttk

root = tk.Tk()

label = ttk.Label(root, text="Test Callback")
btn = tk.Button(root, text="Text so long that root has to resize.")
btn.pack()
label.pack(expand=True)

root.mainloop()
🌐
GeeksforGeeks
geeksforgeeks.org › python › center-a-label-in-a-frame-of-fixed-size-in-tkinter
Center a Label In a Frame of Fixed Size In Tkinter - GeeksforGeeks
June 18, 2024 - label_name = tkinter.Label(parent,text="text_to_display") To center a Label, we can use the option 'anchor' in its package manager with value of "CENTER".
🌐
Python Forum
python-forum.io › thread-17129.html
How do I center this text in tkinter?
from tkinter import * window = Tk() window.title("List") window.geometry("700x450") window.configure(bg="orange red") #center this label Label (window, text="List", bg="orange red", fg="white", font="
🌐
TutorialsPoint
tutorialspoint.com › article › how-to-center-a-label-in-a-frame-of-fixed-size-in-tkinter
How to center a label in a frame of fixed size in Tkinter?
import tkinter as tk # Create main window root = tk.Tk() root.geometry("600x400") # Create a fixed-size frame frame = tk.Frame(root, width=400, height=250, bg="lightgreen", relief="raised", bd=3) frame.pack(pady=30) frame.grid_propagate(False) # Maintain fixed size # Configure grid to center content frame.grid_rowconfigure(0, weight=1) frame.grid_columnconfigure(0, weight=1) # Create label using grid label = tk.Label(frame, text="Centered with Grid!", font=("Times", 18), bg="yellow") label.grid(row=0, column=0) root.mainloop()
🌐
Reddit
reddit.com › r/learnpython › tkinter: how can i align the text inside a label widget?
r/learnpython on Reddit: Tkinter: How can I align the text inside a label widget?
March 12, 2023 -

[Solved]
If I create a simple label width a text, the widget content is always centered. How can I make the content of the widget align left? (Not the widget itself, but the text in the widget)Wherever I search, I always see the same answer: Set the anchor or sticky option as 'w'. But that still keeps the content of the widget centered.These examples (pack and grid) both still center the text inside the widget:

label = tk.Label(root, text="Line 1\nSecond line", anchor="w")
label.pack()

label = tk.Label(root, text="Line 1\nSecond line")
label.grid(row=0, column=0, sticky="w")
Find elsewhere
🌐
Python Examples
pythonexamples.org › python-tkinter-label-center-align-text
Center Align Text in Tkinter Label Widget
To center align the text in a Label widget in Tkinter, set the anchor parameter to "center".
🌐
Reddit
reddit.com › r/learnpython › how to center a label in a full screen root (tkinter, python 3)
r/learnpython on Reddit: How to center a Label in a Full Screen Root (tkinter, python 3)
January 26, 2020 -

I am trying to do a game-app main screen using tkinter. I google some sintax in order to make a fullscreen root and frame, but i couldnt find how to center the game title... i´ve tried to se Label.place(anchor="center") but it just insert the lebel on the left top of the screen... if you wanna see the code here it is:

import random
from tkinter import *
import tkinter.font

root=Tk()
root.config(bg="#521D46")
root.attributes('-fullscreen', True)
root.bind('<Escape>',lambda e: root.destroy())

Frame1=Frame(root)
Frame1.pack(fill="both", expand=True, padx=2, pady=2)
Frame1.config(bg="#792566",bd=10,relief="flat")


LabelTitle=Label(Frame1, text="SEQUENCE GAME", bg="#521D46", font="TkFixedFont 
24",fg="white")

LabelTitle.place(anchor="center")

root.mainloop()

I dont know what else to do :( ...I´d really appreciate if you help me!

🌐
YouTube
youtube.com › watch
How To Position Label Text The Right Way - Python Tkinter GUI Tutorial #133 - YouTube
In this video I'll show you how to position label text inside of the widget. We'll look at justifying the text to the left, right, and center.To move the pos...
Published   October 12, 2020
🌐
GeeksforGeeks
geeksforgeeks.org › setting-the-position-of-tkinter-labels
Setting the position of TKinter labels | GeeksforGeeks
April 28, 2025 - We can update this text at any point in time. ApproachImport moduleCreate a windowSet a label widget with required attributes for borderP ... Prerequisites: Introduction to tkinter Tkinter is a standard GUI (Graphical user interface) package for python. It provides a fast and easy way of creating a GUI application.
🌐
Python.org
discuss.python.org › python help
[tkinter] How do I vertically center text to window in GUI? - Python Help - Discussions on Python.org
November 14, 2024 - Hello, I’m new to using tkinter and I am attempting to center the text in the GUI to always be vertically center of the window. Currently the text is center to the left of the canvas. I cant tell whether its the frame or…
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-align-text-in-tkinter-label
How To Align Text In Tkinter Label? - GeeksforGeeks
July 23, 2025 - The justify parameter in the Tkinter Label widget allows you to specify the horizontal alignment of text within the label. By default, text is left-aligned. However, you can set it to 'left', 'center', or 'right' based on your requirements.
🌐
Python Tutorial
pythontutorial.net › home › tkinter tutorial › tkinter label
Tkinter Label - Python Tutorial
April 3, 2025 - In this tutorial, you'll learn about Tkinter Label widget and how to use it to display a text or image on the screen.
Top answer
1 of 2
5

In the case of placing a single widget in the center of another widget, place is the best choice. It has options to locate a widget relative to another widget (usually, but not necessarily, relative to its parent).

In your case, you want the center of the label in the center of its parent. You can use a relative X coordinate of .5, a relative Y coordinate of .5, and an anchor of "center", meaning that the center of the widget is placed at the given coordinates.

Example:

nameLabel.place(relx=.5, rely=.5, anchor="center")
2 of 2
1

Tkinter has two options to show widgets

grid() or pack()

Using pack():

In this case this is probably the best option -since you are dealing with only 1 widget:

By default top and bottom will align a widget to the center. Left and right will align to the left and right respectively.

Here an extract of your code demonstrating this property:

nameLabel = Label(welcome, text="Welcome", bg="gray", fg="white") 
nameLabel.pack(side="top")

You can also center align text at the bottom as well:

nameLabel = Label(welcome, text="Welcome", bg="gray", fg="white")
nameLabel.pack(side="bottom")

Using grid():

Sometimes it may become necessary to align multiple widgets. You can position them individually and accurately using grid():

nameLabel1 = Label(welcome, text="Welcome", bg="gray", fg="white")
nameLabel1.grid(column=0, row = 1)
nameLabel2 = Label(welcome, text="Welcome", bg="gray", fg="white") 
nameLable2.grid(column=1, row = 1)
nameLabel3 = Label(welcome, text="Welcome", bg="gray", fg="white")
nameLabel3.grid(column=2, row = 1)

Update: Further to your centring label in window comment I do not know how to do this myself although I have found this post that seems to do what you want

🌐
Python Course
python-course.eu › tkinter › labels-in-tkinter.php
1. Labels in Tkinter | Tkinter | python-course.eu
If you set the compound option to CENTER the text will be drawn on top of the image: import tkinter as tk root = tk.Tk() logo = tk.PhotoImage(file="python_logo_small.gif") explanation = """At present, only GIF and PPM/PGM formats are supported, but an interface exists to allow additional image ...