How Do I Center an Image in the Readme Md File on Github

As a software developer or technical writer, you may have come across the need to include images in your Github file.

Whether you want to showcase screenshots, add visual aids, or simply make your README file more appealing, adding images to your file is an excellent way to achieve these goals.

However, the default alignment of images in Github files is left-aligned.

In this tutorial, we’ll cover how to center an image in a Github file, making your file more professional and aesthetically pleasing.

The Markdown Syntax for Centering an Image

Github files use the markdown language to format text and images.

To center an image in a markdown file, you’ll need to use the following syntax:

<p align="center">
  <img src="image_url">

Here’s an example of what the code above would look like in a Github file:

<p align="center">
  <img src="">

Adding an Image to your Github File

To add an image to your Github file, you’ll need to first upload the image to a hosting service such as Imgur or Cloudinary.

Once you’ve uploaded the image, you’ll be given a direct link to the image.

This direct link is what you’ll use in the markdown syntax to display the image in your Github file.

Here’s an example of how to add an image to a Github file using Imgur:

  1. Go to
  2. Click on the “Upload Images” button
  3. Select the image you want to upload
  4. Once the image has been uploaded, click on the “Copy” button next to the “Direct Link”
  5. In your Github file, paste the following code, replacing “image_url” with the direct link you copied from Imgur:
<p align="center">
  <img src="image_url">


Centering an image in a Github file is a simple process that can greatly enhance the visual appeal of your file.

By using the markdown syntax and uploading your image to a hosting service, you can center an image in your Github file with ease.

Whether you’re a software developer, technical writer, or just looking to make your Github file stand out, adding centered images is a great way to achieve your goal.