TodayTools

Compare protocols

FTP vs SFTP: the difference and which to use

Donate
What brings you here?

The difference at a glance

FTP

File Transfer Protocol

Best for: Old devices that speak nothing else

Password and files travel as plain text anyone can read.
  1. Password, from You
  2. OK, from File server
  3. File, from You

SFTP

SSH File Transfer Protocol

Best for: Any file transfer over the internet

One locked SSH connection carries the login and the files.
  1. Key check, from You
  2. Login, from You, locked
  3. File, from You, locked

The short answer

FTP sends your password and files as plain text and uses two connections, one for commands and one for each file. SFTP is a different protocol that runs inside an SSH connection on port 22, so the login and every file are encrypted and only one connection is needed. Use SFTP. Keep FTP for old systems that cannot do anything else.

Which one fits you?

Tick everything that is true for you.

What do you need?

Your pick shows here

Tick one or more lines and we weigh them for you.

FTP and SFTP side by side

FTP vs SFTP: differences row by row
What differsFTPSFTP
EncryptionNone (FTPS adds TLS)Always, through SSH
Ports21 for commands, plus 20 or a random port for data22 only
ConnectionsTwo: control and dataOne
Firewalls and NATAwkward: active and passive modesSimple: one TCP port
LoginUsername and password, sent as textPassword or SSH key
MessagesText commands like USER, PASS, RETR, STORBinary packets inside SSH
StandardRFC 959 (1985)IETF draft, part of the SSH tool set

Watch each one work

Each page plays the real packets on a map, step by step, with every header explained.

Test yourself

Each line describes one of the two. Which one?

Question 1 of 7

Encryption

None (FTPS adds TLS)

Questions people ask

Is SFTP the same as FTPS?

No. FTPS is the old FTP with TLS added, still on two connections. SFTP is a separate protocol that runs inside SSH.

Is SFTP FTP over SSH?

Not really. It is its own file protocol built for SSH. It does not use FTP commands, and FTP clients only speak it when they support SFTP as a separate option.

Why is FTP unsafe?

FTP sends the username, password and files without encryption. Anyone on the same network or path can read them with a packet capture.

What port does SFTP use?

Port 22, the SSH port, unless the server runs SSH on another port.

More comparisons

Donate