diff --git a/include/libcamera/fraction.h b/include/libcamera/fraction.h
new file mode 100644
index 00000000..aa6a1abb
--- /dev/null
+++ b/include/libcamera/fraction.h
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2021, Pengutronix, Marian Cichy <entwicklung@pengutronix.de>
+ *
+ * fraction.h - A fraction consisting of two integers
+ */
+
+#ifndef __LIBCAMERA_FRACTION_H__
+#define __LIBCAMERA_FRACTION_H__
+
+namespace libcamera {
+
+class Fraction {
+public:
+	constexpr Fraction() :
+		numerator(0), denominator(0)
+	{
+	}
+
+	constexpr Fraction(unsigned int num, unsigned int den) :
+		numerator(num), denominator(den)
+	{
+	}
+
+	unsigned int numerator;
+	unsigned int denominator;
+
+	const std::string toString() const;
+};
+
+} /* namespace libcamera */
+
+#endif /* __LIBCAMERA_FRACTION_H__ */
diff --git a/src/libcamera/fraction.cpp b/src/libcamera/fraction.cpp
new file mode 100644
index 00000000..76c373aa
--- /dev/null
+++ b/src/libcamera/fraction.cpp
@@ -0,0 +1,60 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2021, Pengutronix, Marian Cichy <entwicklung@pengutronix.de>
+ *
+ * fraction.h - A fraction consisting of two integers
+ */
+
+#include <string>
+#include <sstream>
+
+#include <libcamera/fraction.h>
+
+/**
+ * \file fraction.h
+ * \brief A fraction consisting of two integers.
+ */
+
+namespace libcamera {
+
+/**
+ * \class Fraction
+ * \brief Represents a fraction with a nominator and a denominator.
+ */
+
+/**
+ * \fn Fraction::Fraction()
+ * \brief Construct a Fraction with value 0/0. This should be interpreted
+ * as invalid or not-used Fraction.
+ */
+
+/**
+ * \fn Fraction::Fraction(unsigned int num, unsigned int den)
+ * \brief Construct a Fraction with value n/d.
+ */
+
+/**
+ * \var Fraction::numerator
+ * \brief The numerator of the fraction.
+ */
+
+/**
+ * \var Fraction::denominator
+ * \brief The denominator of the fraction.
+ */
+
+/**
+ * \brief Assemble and return a string describing the fraction
+ * \return A string describing the fraction.
+ */
+const std::string Fraction::toString() const
+{
+	std::stringstream ss;
+
+	ss << numerator << "/" << denominator;
+
+	return ss.str();
+}
+
+} /* namespace libcamera */
diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
index 815629db..7927481f 100644
--- a/src/libcamera/meson.build
+++ b/src/libcamera/meson.build
@@ -22,6 +22,7 @@ libcamera_sources = files([
     'file.cpp',
     'file_descriptor.cpp',
     'formats.cpp',
+    'fraction.cpp',
     'framebuffer_allocator.cpp',
     'geometry.cpp',
     'ipa_controls.cpp',
