IEC 61131-3 Data Type Size Calculator
Estimate PLC scalar, string, and array type sizes in bits and bytes for IEC 61131-3 workflows.
Type Inputs
Estimated Size
⚠️ Engineering Caution:
This tool is intended for screening and pre-check workflows. Results are usually directionally useful, but they
can still shift with equipment selection, environmental conditions, naming conventions, revision status, or
interpretation rules. Confirm any value that affects ordering, substitution, compliance, or installation before
acting on it.
Frequently Asked Questions
Does this calculator include vendor-specific alignment?
No. This tool estimates base payload size for common IEC types, strings, and arrays. Exact offsets and padding can still vary by PLC vendor and runtime.
How is STRING size estimated?
A practical planning assumption is one byte per character plus an additional byte for a terminator, so STRING(n) is estimated as n + 1 bytes. WSTRING uses a two-byte character model here.
What This Calculator Is For
IEC 61131-3 projects often require quick answers about how much memory a variable, string, or array will consume. That question comes up when planning PLC memory layouts, HMI mappings, protocol payloads, retained data, and structured variable design.
Typical practical questions include:
- How many bytes does
LREALorULINTuse? - How large is
STRING(32)in bytes? - What is the total size of an array such as
ARRAY[0..15] OF INT? - How many bits and bytes will a candidate tag structure consume before alignment is considered?
- Which IEC scalar types are the most space-efficient for a given range?
This calculator is designed for those practical engineering checks.
What It Calculates
The tool estimates:
- bit size for the selected IEC data type
- byte size for the selected IEC data type
- total bytes for simple arrays
- total bytes for IEC
STRING(n)declarations - a quick memory-planning note describing the selected type
It focuses on type payload size first. It does not apply vendor-specific alignment or structure padding rules automatically.
Included IEC Type Coverage
This calculator includes common IEC 61131-3 types used in PLC programming workflows, including:
BOOLBYTE,WORD,DWORD,LWORDSINT,USINT,INT,UINT,DINT,UDINT,LINT,ULINTREAL,LREALTIME,DATE,TIME_OF_DAY,DATE_AND_TIMECHAR,WCHARSTRING,WSTRING
Core Relationships
Total Array Bytes = Element Bytes × Element CountSTRING(n) Bytes = n + 1for a typical single-byte character storage model with terminatorWSTRING(n) Bytes = (n + 1) × 2for a typical wide-character storage model
These formulas are intentionally practical. Vendor implementations can differ for metadata, alignment, or reserved overhead.
Important Limitations
This tool is intended for first-pass IEC memory planning, not vendor-certified final memory accounting. Actual implementation size can differ because of:
- controller-specific alignment rules
- structure padding
- string implementation differences
- compiler-specific overhead
- retained-memory bookkeeping
- protocol packing rules
If exact PLC memory layout matters, confirm with the target runtime, compiler, or vendor documentation.
FAQ
Does IEC 61131-3 define exact memory layout for every vendor?
No. The standard defines language behavior and data-model concepts, but actual memory layout, padding, and alignment can differ between PLC platforms and runtimes.
Why is STRING(n) often treated as n + 1 bytes?
A common practical assumption is one byte per character plus a null terminator. Some platforms may store additional metadata or use different conventions.
Can I use this instead of a vendor memory mapper?
Use it as a fast type-size estimator. For exact offsets in a real PLC memory block, pair it with vendor-specific mapping rules or a dedicated memory layout tool.