diff --git a/src/tools/middle-endian-converter/index.ts b/src/tools/middle-endian-converter/index.ts
new file mode 100644
index 00000000..5b7c5648
--- /dev/null
+++ b/src/tools/middle-endian-converter/index.ts
@@ -0,0 +1,13 @@
+import { Binary } from '@vicons/tabler';
+import { defineTool } from '../tool';
+
+export const tool = defineTool({
+ name: 'Middle-Endian Converter',
+ path: '/middle-endian-converter',
+ description: 'Convert bytes from Middle-Endian to Little/Big Endian for given bits precision and type of Middle Endian',
+ keywords: ['middle', 'endian', 'converter'],
+ component: () => import('./middle-endian-converter.vue'),
+ icon: Binary,
+ createdAt: new Date('2025-08-15'),
+ category: 'Forensic',
+});
diff --git a/src/tools/middle-endian-converter/middle-endian-converter.service.test.ts b/src/tools/middle-endian-converter/middle-endian-converter.service.test.ts
new file mode 100644
index 00000000..9b6d3a42
--- /dev/null
+++ b/src/tools/middle-endian-converter/middle-endian-converter.service.test.ts
@@ -0,0 +1,34 @@
+import { describe, expect, it } from 'vitest';
+import { convertEndian, formatInteger } from './middle-endian-converter.service';
+
+describe('convertEndian', () => {
+ it('converts 32-bit byte-swapped correctly', () => {
+ const result = convertEndian('0A0B0C0D', 32, 'byte-swapped');
+ expect(result.bigEndian).toBe('0x0B0A0D0C');
+ expect(result.littleEndian).toBe('0x0C0D0A0B');
+ });
+
+ it('converts 64-bit word-swapped correctly', () => {
+ const result = convertEndian('0A0B0C0D0E0F1234', 64, 'word-swapped');
+ expect(result.bigEndian).toBe('0x0C0D0A0B12340E0F');
+ expect(result.littleEndian).toBe('0x0F0E34120B0A0D0C');
+ });
+
+ it('throws on invalid hex', () => {
+ expect(() => convertEndian('ZZZZ', 32, 'byte-swapped')).toThrow();
+ });
+
+ it('throws on incorrect length', () => {
+ expect(() => convertEndian('1234', 32, 'byte-swapped')).toThrow();
+ });
+});
+
+describe('formatInteger', () => {
+ it('should convert input hex to octal, decimal and hexa', () => {
+ expect(formatInteger('0xFF')).toEqual({
+ decimal: '255',
+ octal: '0o377',
+ hexadecimal: '0xFF',
+ });
+ });
+});
diff --git a/src/tools/middle-endian-converter/middle-endian-converter.service.ts b/src/tools/middle-endian-converter/middle-endian-converter.service.ts
new file mode 100644
index 00000000..2d885c1b
--- /dev/null
+++ b/src/tools/middle-endian-converter/middle-endian-converter.service.ts
@@ -0,0 +1,71 @@
+export interface EndianResult {
+ bigEndian: string
+ littleEndian: string
+};
+
+export function convertEndian(
+ hexInput: string,
+ bitLength: 16 | 32 | 64,
+ middleEndianType: 'byte-swapped' | 'word-swapped',
+): EndianResult {
+ const hex = hexInput.replace(/^0x/, '').toUpperCase();
+
+ if (!/^[0-9A-F]+$/.test(hex)) {
+ throw new Error('Invalid hex input. Only 0-9 and A-F allowed.');
+ }
+
+ const byteCount = bitLength / 8;
+ if (hex.length !== byteCount * 2) {
+ throw new Error(`Input must be ${byteCount * 2} hex characters for ${bitLength}-bit.`);
+ }
+
+ const bytes = hex.match(/.{2}/g);
+ if (!bytes) {
+ throw new Error('Failed to parse bytes.');
+ }
+
+ const reordered: string[] = [];
+
+ if (middleEndianType === 'byte-swapped') {
+ for (let i = 0; i < bytes.length; i += 2) {
+ reordered.push(bytes[i + 1], bytes[i]);
+ }
+ }
+ else if (middleEndianType === 'word-swapped') {
+ for (let i = 0; i < bytes.length; i += 4) {
+ reordered.push(...bytes.slice(i + 2, i + 4), ...bytes.slice(i, i + 2));
+ }
+ }
+ else {
+ throw new Error('Unsupported middle-endian format.');
+ }
+
+ return {
+ bigEndian: `0x${reordered.join('')}`,
+ littleEndian: `0x${[...reordered].reverse().join('')}`,
+ };
+}
+
+export function formatInteger(hexInput: string): {
+ decimal: string
+ octal: string
+ hexadecimal: string
+} {
+ try {
+ const hex = hexInput.replace(/^0x/, '');
+ const intValue = BigInt(`0x${hex}`);
+
+ return {
+ decimal: intValue.toString(10),
+ octal: `0o${intValue.toString(8)}`,
+ hexadecimal: `0x${intValue.toString(16).toUpperCase()}`,
+ };
+ }
+ catch {
+ return {
+ decimal: 'Invalid',
+ octal: 'Invalid',
+ hexadecimal: 'Invalid',
+ };
+ }
+}
diff --git a/src/tools/middle-endian-converter/middle-endian-converter.vue b/src/tools/middle-endian-converter/middle-endian-converter.vue
new file mode 100644
index 00000000..14f4697b
--- /dev/null
+++ b/src/tools/middle-endian-converter/middle-endian-converter.vue
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+ {{ result.error }}
+
+
+
+
+
+
+
+
+
+
+