The calculated distance (air line) between Magherafelt and Edinburgh is approximately 157 miles respectively 253 kilometers.
By car or train, the actual journey to Edinburgh is certainly longer, as only the direct route (as the crow flies) between Magherafelt and Edinburgh has been calculated here.
Air line (approximately)
253 kilometers
137 nautical miles