ThisCalculator

Everyday

Directory Listing: What It Is & How It Works

Updated · Standard formula, shown below

Download speed (MB/min) 100.00 MB/min
Time to download (min)
1 min
You entered
File size (MB)
100 MB
You entered

Directory listing is a web server feature that displays the contents of a folder when no default file (like index.html) exists. You enter a URL that points to a directory, and the server generates a simple page showing all files and subfolders in that directory, often with their sizes and modification dates. This article explains what directory listing is, how it works, why it appears, and what you should know about its security implications.

Formula

The download speed is calculated by dividing the file size by the time taken:

Speed = File size / Time

Where:

  • File size is in megabytes (MB)
  • Time is in minutes (min)
  • Speed is in megabytes per minute (MB/min)

To convert to megabits per second (Mbps), multiply by 8 and divide by 60.

Worked Example

Using the default values from the calculator:

  1. File size = 100 MB
  2. Time = 1 minute
  3. Speed = 100 MB / 1 min = 100 MB/min
  4. Convert to Mbps: 100 × 8 / 60 = 13.33 Mbps

The calculator shows 100.00 MB/min, which matches the formula.

What Is Directory Listing?

Directory listing is a server-side feature that, when enabled, lets anyone browse the files in a web directory. For example, if you visit https://example.com/files/ and there is no index.html in that folder, the server might show a list of all files in /files/. This is often called an “index of” page because the default Apache listing shows “Index of /files” at the top.

The term “directory listing” is standard in web server documentation and security contexts. It is not slang or informal—it is the official name used in Apache, Nginx, IIS, and other server software. The origin comes from the early days of the web when FTP servers used similar listings, and the concept was carried over to HTTP.

How Does Directory Listing Work?

When a web server receives a request for a directory, it looks for a default index file (like index.html or index.php). If none exists, the server can either return a 403 Forbidden error or generate an automatic listing. The latter is what we call directory listing.

The server reads the folder’s contents and creates an HTML page with links to each file and subfolder. It typically shows:

  • File names and icons
  • File sizes (in bytes or human-readable)
  • Last modified dates
  • Parent directory link (usually “../”)

For example, Apache’s default listing is a simple table with columns for Name, Last modified, Size, and Description. Nginx has a similar feature called autoindex. IIS uses the “Directory Browsing” feature.

Why Does Directory Listing Appear?

Directory listing appears when two conditions are met:

  1. The server has directory listing enabled (either globally or for that folder).
  2. There is no index file in the directory.

Sometimes developers accidentally leave it on during development. Other times, it is intentionally enabled for public file sharing (e.g., a folder of downloadable documents). However, in production, it is often disabled for security reasons.

Security Risks of Directory Listing

Directory listing itself is not a vulnerability, but it can expose sensitive information. If a folder contains backup files, configuration files, or personal data, anyone can see and download them. Attackers often scan for directory listings to find:

  • Database dumps or SQL files
  • Backup archives (like .zip or .bak)
  • Source code or configuration files
  • Hidden files (e.g., .env)

Even if the files are not directly accessible, the listing reveals the directory structure, which helps attackers plan further attacks. Therefore, security best practices recommend disabling directory listing unless absolutely necessary.

How to Disable Directory Listing

The method depends on your web server:

  • Apache: Add Options -Indexes to your .htaccess file or the virtual host configuration.
  • Nginx: Set autoindex off; in the server or location block.
  • IIS: Disable “Directory Browsing” in the IIS Manager or via web.config.

Alternatively, you can create an index.html file in the directory to override the listing. This is often the simplest fix.

Directory Listing vs. Index Page

An index page (like index.html) is a default file that the server loads when a directory is requested. It is a normal webpage you design. Directory listing is an auto-generated page that the server creates on the fly. The key difference is control: with an index page, you decide what visitors see; with directory listing, they see the raw file structure.

Many web hosts disable directory listing by default for security. If you see a listing, it may be because the host has not disabled it or because the developer forgot to add an index file.

Frequently Asked Questions

Is directory listing a security vulnerability?

No, it is not a vulnerability by itself, but it can be a security risk if sensitive files are present. It is best to disable it unless you intentionally want to share files.

How do I enable directory listing in Nginx?

Add autoindex on; in your server or location block, then reload Nginx. This will show listings for directories without an index file.

Why do I see “Index of /” on my website?

This means directory listing is enabled and there is no index file in the root directory. Create an index.html or disable listing in your server configuration.

Can directory listing be used for legitimate purposes?

Yes, many sites use it to share public files like software downloads, datasets, or documents. It is also useful for internal file sharing on private networks.

What is the difference between directory listing and FTP?

FTP is a separate protocol for file transfer, while directory listing is an HTTP feature. Both can show file lists, but FTP requires a dedicated client and has more features like upload and delete.

Related

Formula used
in t | Time to download (min) | min | 1 | 0
in s | File size (MB) | MB | 100 | 0
out speed | Download speed (MB/min) | MB/min | s / t | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.