In computer science, porting is the adaptation of a piece of software so that it will function in a compting environment different than that for which it was originally written.

Porting is usually required because of differences in the central processing unit, operating system interfaces, different hardware or because of subtle incompatibilities in - or even complete absence of - the programming language used on the target environnement.

Portability is the property of software that is easy to port. As operating systems, languages, and programming techniques evolves, software becomes increasingly simple to port from environment to environment. One of the original objectives of the C programming language and the standard C library, for instance, was to ease porting of software from computer to computer by providing a consistent API between different and otherwise incompatible computing hardware.

International standards, such as those promulgated by ISO, greatly facilitate porting because they specify the details of the computing environment in a way that varies very little between platforms. Often, porting software between two platforms that implement the same standard (such as, for instance, POSIX.1), is simply a matter of recompiling the program on the new platform.

There also exists an increasing number of tools to facilitate porting, such as GCC which provides consistent programing languages on different platforms, and autoconf which automates the detection of minor variations in the environment and adapts the software accordingly before compilation.

Two activities related to, but distinct from, porting are emulating and cross-compiling.

Porting is also the term used when a computer game is ported to a video game console, or vice versa. Earlier video game ports were not true ports but rather complete rewrites, but more and more video games are developed using editing software which can output code for the PC as well as one or more consoles. Many early ports suffered from bad quality because the hardware of PCs and consoles is very different.