diff --git a/frappe/core/doctype/document_comparator/document_comparator.html b/frappe/core/doctype/document_comparator/document_comparator.html
new file mode 100644
index 0000000000..3b4950adea
--- /dev/null
+++ b/frappe/core/doctype/document_comparator/document_comparator.html
@@ -0,0 +1,74 @@
+
+
+
+ {% if documents.length > 1 %}
+
Documents to Compare : {{ documents.length }}
+ {% else %}
+
Documents to Compare : {{ documents.length - 1 }}
+ {% endif %}
+
+
+ {% var field_keys = Object.keys(changed).sort(); %}
+ {% if field_keys.length > 0 %}
+
+
Changes
+
+
+ | Fields |
+ {% for doc in documents %}
+ {{ doc }} |
+ {% endfor %}
+
+
+ {% for fieldname in field_keys %}
+
+ | {{ fieldname }} |
+ {% var values = changed[fieldname] %}
+
+ {% for value in values %}
+ {{ value }} |
+ {% endfor %}
+
+ {% endfor %}
+
+
+
+ {% endif %}
+
+ {% var tables = Object.keys(row_changed).sort(); %}
+ {% if tables.length > 0 %}
+
+
Rows Updated
+
+
+ | Fields |
+ {% for doc in documents %}
+ {{ doc }} |
+ {% endfor %}
+
+
+ {% for table in tables %}
+
+
| {{ table }} |
+ {% var row_index = row_changed[table]["index"] %}
+ | idx : {{ row_index }} |
+ {% var fields = Object.keys(row_changed[table]).sort(); %}
+ {% for field in fields %}
+ {% if field != "index" %}
+
+ | {{ field }} |
+ {% var values = row_changed[table][field] %}
+ {% for value in values %}
+ {{ value }} |
+ {% endfor %}
+
+ {% endfor %}
+ {% endfor %}
+
+ {% endfor %}
+
+
+
+ {% endif %}
+
+
\ No newline at end of file
diff --git a/frappe/core/doctype/document_comparator/document_comparator.js b/frappe/core/doctype/document_comparator/document_comparator.js
new file mode 100644
index 0000000000..22e73a848f
--- /dev/null
+++ b/frappe/core/doctype/document_comparator/document_comparator.js
@@ -0,0 +1,35 @@
+// Copyright (c) 2023, Frappe Technologies and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on("Document Comparator", {
+ refresh(frm) {
+ frm.disable_save();
+
+ frm.set_query("doctype_name", () => {
+ return {
+ filters: {
+ track_changes: 1,
+ },
+ };
+ });
+
+ frm.page.set_primary_action("Compare", () => {
+ frm.call({
+ doc: frm.doc,
+ method: "compare_document",
+ callback: function (r) {
+ let document_names = r.message[0];
+ let changed_fields = r.message[1];
+ let render_dict = {
+ documents: document_names,
+ changed: changed_fields.changed,
+ row_changed: changed_fields.row_changed,
+ };
+ $(frappe.render_template("document_comparator", render_dict)).appendTo(
+ frm.fields_dict.version_table.$wrapper.empty()
+ );
+ },
+ });
+ });
+ },
+});